(10%)
Determine whether the following code is correct or not. If it is
correct, predict its output. If it is incorrect, point out the
mistake(s).
// Pointers as Arguments to a Function
#include <iostream>
int strlen(char* s)
{
char* p = s;
while (*s != '\0')
++s;
return s - p;
}
int main()
{
char* str = "NCNU";
int n = strlen(str);
printf("The length of \"%s\" is %d.\n",
str, n);
return 0;
}