Solved

what does this error mean

Posted on 2003-10-27
6
214 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:
Kent Olsen earned 250 total points
ID: 9629144

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
ID: 9629295
i am not using any chararcters in my program.
0
 
LVL 3

Expert Comment

by:klopex
ID: 9629332
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:buckeyes33
ID: 9629334
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
ID: 9629339
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
ID: 9629352
I'm not quite sure what you mean by "parse error". Isn't "unterminated character constant" a parse error?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
why debugging a macro i s difficult 10 41
C dll call freezes 5 112
An API detour question 7 101
If a cell in a range equals "YES" return specific Test. 4 42
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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 how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

685 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