Solved

what does this error mean

Posted on 2003-10-27
6
210 Views
Last Modified: 2010-04-15
when I complied my programm i got this error three different times

unterminated character constant

i can not determine what it is.
0
Comment
Question by:buckeyes33
6 Comments
 
LVL 45

Accepted Solution

by:
Kdo earned 250 total points
Comment Utility

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,
Kent

0
 
LVL 9

Author Comment

by:buckeyes33
Comment Utility
i am not using any chararcters in my program.
0
 
LVL 3

Expert Comment

by:klopex
Comment Utility
Try doing a search for the single quote character  '

Mine is near my enter key.  It is possible you have hit it on occasion.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 9

Author Comment

by:buckeyes33
Comment Utility
ok a character did not mater.  Just one thing.  Why did that not show up as a parse error?
0
 
LVL 16

Expert Comment

by:imladris
Comment Utility
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.
0
 
LVL 16

Expert Comment

by:imladris
Comment Utility
I'm not quite sure what you mean by "parse error". Isn't "unterminated character constant" a parse error?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now