Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » warning: multi-character character constant(warning: multi-character character constant)
warning: multi-character character constant [message #872222] Tue, 15 May 2012 17:43 Go to next message
Ramkumar Sivaraman is currently offline Ramkumar SivaramanFriend
Messages: 3
Registered: May 2012
Junior Member
Hello
I am getting this warning,
warning: multi-character character constant

I know why I am getting this error, since I am comparing an integer to a two letter string constant in single quotes,

#define CMD_ID 'ID'
int iCommand;

switch(iCommand)
{
case CMD_ID: // warning: multi-character character constant
break;
}

But I cannot modify the code to prevent as that leads to many changes. Rather I want to suppress the warning. How can I do it in eclipse IDE or inside the code? My program is in C in Linux.
Re: warning: multi-character character constant [message #872524 is a reply to message #872222] Wed, 16 May 2012 09:14 Go to previous message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
You can't do this in C.

The switch instruction can compare only integers. A single character can be converted in an integer, but not more.
Previous Topic:can I make like this(editor)?
Next Topic:var type could not be resolved, but programm can be compiled
Goto Forum:
  


Current Time: Thu Apr 25 01:29:54 GMT 2024

Powered by FUDForum. Page generated in 0.02717 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top