said:
>char ReadFileName;
>ReadFileName = "Harry";
This should be either:
char *ReadFileName = "Harry"; // Pointer to character initialize to
point to a string
or
char ReadFileName[] = "Harry"; // Array of 6 characters initialized to
...
or
char ReadFileName[20] = "Harry"; // Array of 20 characters initialized
to ...
depending on exactly how you want to use ReadFileName. The first two
forms are fine if the string is a constant. The latter is better if you
are setting a default which you might override.
What you defined was a character, not an array of characters.
>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?
Not quite:
char aChar = 'a'; // A character initialized to the
letter a
printf("aChar is set to '%c'\n", aChar);
Does that clarify things?
Steven
--
---------------------------------------------------------------------
"Steven Levine" MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
---------------------------------------------------------------------
=====================================================
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.