• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

what does this error mean

when I complied my programm i got this error three different times

unterminated character constant

i can not determine what it is.
1 Solution
Kent OlsenData Warehouse Architect / DBACommented:

Character constants are "mini-strings".  Each must start and end with a quote.

Strings use double quotes.  "This is a string" must start end and with the double-quote character for C to properly recognize the value as a string.

Character constants use single quotes.  'A' is the proper way to quote a single character.

Here's how the two look in C code:

char Name[20] = "My Name";
char Grade = 'A';

if (Grade == 'A')
  strcpy (Name, "Kdo");

Good Luck,

buckeyes33Author Commented:
i am not using any chararcters in my program.
Try doing a search for the single quote character  '

Mine is near my enter key.  It is possible you have hit it on occasion.
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

buckeyes33Author Commented:
ok a character did not mater.  Just one thing.  Why did that not show up as a parse error?
You may not be *intending* to use any characters. However, the error message indicates that the compiler has come across a line that has a quote character in it. Since it doesn't find a second one, the compiler is constrained to assume that it is missing.

Quotes can sometimes be hard to see. If the compiler tells you what line the problem is on, it may be simpler to delete it and retype it.
I'm not quite sure what you mean by "parse error". Isn't "unterminated character constant" a parse error?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Managed Security Services Webinar - March 15

Selecting the right managed security services platform to grow your business can be a huge undertaking. Join WatchGuard and Frost & Sullivan in an upcoming webinar as we dive into the key elements of selecting a vendor platform and partnership to fuel a successful MSSP business.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now