dear sir
i am having a simple doubt in pointer concept.
i am reading in 3 names using a string pointer,
and printing them ,,
it works out perfectly fine..
but i get a "warning message"
Integral value implicitly converted to pointer in assignment,
i am using hp-unix system.
i would be greatful if anyone could let me know why this message
is thrown up by the compiler
Code:#include <stdio.h> void main() { char *str[3]; int i; printf(" enter the names of 3 students"); for(i=0;i<3;i++) { str[i] = malloc(10); scanf("%s",str[i]) ; } printf(" the name of the first students is %s\n",*(str+0)); printf("the name of th e second student is %s\n",*(str+1)); printf("the name of the third student is %s\n",*(str+2)); }



LinkBack URL
About LinkBacks


