Assign char variable with multi-character constant

S

saurabh29789

Consider the following statement :

char ch='87';

Is this behavior defined? If yes, then what is that behavior? and if
no, then what does the standard say about the same?

I searched the C99 but couldn't find any clause pertaining to it.
 
S

saurabh29789

saurabh29789 said:




Yes, it's implementation-defined.


Implementation-defined. Consult your documentation.



C99 6.4.4.4(10): "The value of an integer character constant
containing more than one character (e.g., 'ab'), or containing a
character or escape sequence that does not map to a single-byte
execution character, is implementation-defined."

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999



Thanks !!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top