Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > Re: too many ch...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 4047 of 4306
Post > Topic >>

Re: too many characters in constant error

by "Daniel T." <daniel_t@[EMAIL PROTECTED] > Mar 5, 2008 at 07:07 PM

yogi_bear_79 <yogi_bear_79@[EMAIL PROTECTED]
> wrote:

> I get three errors with the below code snippet.  Can someone help me
> with the syntax?
> 
> char *month = strtok_s(longDate, " ", &nextToken);
> switch ( *month )
> {
> case 'March':

You have too many characters in the above constant.

>      a = 1;
>      break;
> case 'April':

You have too many characters in the above constant.

>      a = 2;
>      break;
> case 'May':

You have too many characters in the above constant.

>      a = 3;
>      break;
> default:
>     break;
> }

Read about the difference in using the single quote character as opposed 
to the double quote character.
 




 6 Posts in Topic:
too many characters in constant error
yogi_bear_79 <yogi_bea  2008-03-05 15:08:50 
Re: too many characters in constant error
"Daniel T." <  2008-03-05 19:07:50 
Re: too many characters in constant error
yogi_bear_79 <yogi_bea  2008-03-05 16:16:19 
Re: too many characters in constant error
"Daniel T." <  2008-03-05 20:04:27 
Re: too many characters in constant error
yogi_bear_79 <yogi_bea  2008-03-05 19:17:00 
Re: too many characters in constant error
Francis Glassborow <fr  2008-03-06 12:52:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 12:30:00 CDT 2008.