Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

what does this error mean

Posted on 2003-10-27
6
Medium Priority
?
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 1000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Industry Leaders: 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

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

609 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