What does this program do?
1 // ex07_20.c
2 // what does this program do?
3 #include
4 #define SIZE 80
5
6 size_t mystery2(const char *s); // prototype
7
8 int main(void)
9 {
10 char string[SIZE]; // create char array
11
12 puts("Enter a string: ");
13 scanf("%79s", string);
14 printf("%d\n", mystery2(string));
15 }
16
17 // What does this function do?
18 size_t mystery2(const char *s)
19 {
20 size_t x;
21
22 // loop through string
23 for (x = 0; *s != '\0'; ++s) {
24 ++x;
25 }
26
27 return x;
28 }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.