#include <stdio.h>
#include <string.h>
#define SIZE 16
int StringIsEmpty(char s[], int size);
int main(void)
{
char s[SIZE] = "That Code!";
if (StringIsEmpty(s, SIZE))
printf("Empty\n");
else
printf("NOT Empty\n");
memset(s, '\0', sizeof(s));
if (StringIsEmpty(s, SIZE))
printf("Empty\n");
else
printf("NOT Empty\n");
return 0;
}
int StringIsEmpty(char s[], int size)
{
int i = 0, count = 0;
while (s[i++] == '\0') count++;
return size == count;
}
/*
run:
NOT Empty
Empty
*/