mixing pointers and arrays
dixon at ihuxa.UUCP
dixon at ihuxa.UUCP
Sun Jul 31 08:11:50 AEST 1983
1.) The routine stat() placed the binary values for 'y', 'e', 'a', and 'r'
(NOT necessarily in that order) in the global storage location yytext
that was defined for the global area yytext. In the printf() statement
the *yytext argument instructed the system to get the contents at the
location given by the value in yytext. For the binary values of 'y', 'e',
'a', and 'r' this is a VERY large number (assuming unsigned for character
pointers). Much larger than the amount of memory you are apt to have on
a VAX 780 system.
2.) If you wanted to print a string of characters using a pointer to that
string, then you should use
printf("%s\n",yytext); rather than
printf("%s\n",*yytext);
since yytext has been declared to be a pointer to a charcter string.
More information about the Comp.lang.c
mailing list