Secret
2012-05-01 04:01:08 UTC
For the line "int array[]= *ptr;
There is an error "invalid type argument of 'unary *' (have 'int')"
For line "int *ptr= &message[80];"
There is a warning "initialization from incompatible pointer type"
# include "stdio.h"
int ptr;
stringlength(ptr){
int count=0;
int array[]= *ptr;
while(array[count]!='\0'){
count ++;}
return count;
}
main(){
char message[80]="hello";
int *ptr= &message[80];
int count;
stringlength(ptr);
printf("\"%s\" has length %d\n", message, count);
}