/*End include statements*/
char ReadFileName;
ReadFileName = "Harry";
main()
{
printf("\n The value of the variable, ReadFileName, is: %s",
ReadFileName);
return(0);
}
_____________________________________________________________________________________
Line #7 has the declaration for the variable, "ReadFileName". In line #8
I attempt to initialize it to "Harry". The compiler, however, tells me
that there is a variable type mismatch (see the output from the error
log, directly below):
_____________________________________________________________________________________
test.c(8): Error! E1129: Type does not agree with previous definition of
'ReadFileName'
test.c(8): Warning! W102: Type mismatch (warning)
_____________________________________________________________________________________
If I change line #7 to: "int ReadFileName;" and line #8 to:
"ReadFileName = 123;", it compiles and then runs OK (I also have to
change the "%s" in the printf command to "%u" because the variable is
now an integer instead of a string).
The compiler error message is almost as if Watcom does not accept the
"char" keyword as a valid variable declaration. Can anyone help me here?
HCMotin
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 09 |
February |
2002 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.