Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

how to check if an numeric array is empty in c ?? i have int arr[10]; and i have to check if this is empty or not , what should i do ?

OpenStudy (rsmith6559):

Wouldn't you have an index that would be zero if nothing was in there? Do you initialize the elements to an impossible value, then you could check them all for that value.

OpenStudy (anonymous):

if (strcmp(arr, "") == 0) or if(arr[0] == '\0') {}

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!