Solved

what does this error mean

Posted on 2003-10-27
6
213 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

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…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.

825 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