Advertisement
- A
int get_length(char *str) {
int count=0;
while(str[count++]);
return count-1;
} - B
int get_length(char *str) {
int count=0;
while(str!=NULL){
count++;
str++;
}
return count;
} - C
int get_length(char *str) {
int count=0;
while((*str)++)
count++;
return count;
} - D
int get_length(char *str) {
int count=0;
while(str++)
count++;
return count;
}
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.