CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

18F252

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

18F252
PostPosted: Tue Mar 30, 2004 1:41 pm     Reply with quote

The compiler tell me "A numeric expression must appear here" and it highlights "wday"

char wday(9);

if (dow == 1 ) strcpy(wday, "Sunday ");
if (dow == 2 ) strcpy(wday, "Monday ");
if (dow == 3 ) strcpy(wday, "Tuesday ");
if (dow == 4 ) strcpy(wday, "Wednesday");
if (dow == 5 ) strcpy(wday, "Thursday ");
if (dow == 6 ) strcpy(wday, "Friday ");
if (dow == 7 ) strcpy(wday, "Saturday ");
valemike
Guest







use [] instead of ()
PostPosted: Tue Mar 30, 2004 1:43 pm     Reply with quote

If wday is an array, you should use [9], not ().
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

Need 10 Bytes
PostPosted: Tue Mar 30, 2004 11:30 pm     Reply with quote

Shouldn't that be wday[10] to allow for the /0 to null-terminate the string?
_________________
Al Testani
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group