Computing.Net > Forums > Programming > help with c plusplus

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

help with c plusplus

Reply to Message Icon

Name: sixpack
Date: December 7, 2003 at 07:38:25 Pacific
OS: winn 2000
CPU/Ram: 933/256mb
Comment:

trying to write a program, and when I compile and run the program it gives me 19 errors most of them are, unterminated character constants, what does this mean?



Sponsored Link
Ads by Google

Response Number 1
Name: Jason
Date: December 7, 2003 at 11:34:25 Pacific
Reply:

The last character in ANY string should be "\0"


0

Response Number 2
Name: sixpack
Date: December 7, 2003 at 13:39:51 Pacific
Reply:

here is the line that say I have an unterminated character constant

document.write('<layer name="nsdate'+i+'" top=0 left=0 height='+a+'


0

Response Number 3
Name: Dr. Nick
Date: December 7, 2003 at 14:14:57 Pacific
Reply:

Um, that line of code is most certainly NOT C++. Looks more like Javascript, and it looks like your code was cut short.

It looks like the reason you're getting it is that you are not closing the string literal created with your first ('). Try this:

document.write('<layer name="nsdate' + i + ' " top=0 left=0 height=' + a + '>');

Remember that you should always have an EVEN number of literal 'definers' such as (') and ("). If you end up with an odd amount, that means you're missing one somplace.


0

Response Number 4
Name: myxp
Date: December 7, 2003 at 14:37:01 Pacific
Reply:

sixpack:

Try

document.write("<layer name="nsdate'+i+'"
top=0 left=0 height='+a+'");

is "document" a class constructor?


MYXP


0

Response Number 5
Name: sixpack
Date: December 8, 2003 at 17:35:24 Pacific
Reply:

that worked but now I have another problem
my complier say that, an example
font='Arial'; font undeclared (first use this function) chacter constant too long


0

Related Posts

See More



Response Number 6
Name: sixpack
Date: December 9, 2003 at 14:22:03 Pacific
Reply:

char d[] = {'SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY', '\0'};
this line tells me that the character constant is too long, help


0

Response Number 7
Name: Xris
Date: December 10, 2003 at 08:26:48 Pacific
Reply:

I dont understand your last post

char d[] is supposed to be an array of chars right? But what you give after that are not chars, they are words.... It wont work IMHO

I would try

char *d[]={"SUNDAY","M","W","T","F","S"}

the '\0' is not necessary



0

Response Number 8
Name: sixpack
Date: December 10, 2003 at 18:57:31 Pacific
Reply:

I am new at this, javascript and c++ are programming language I have C++ with a complier do I need a different complier to work with javascript or can I use the same one. and if so how is this done?


0

Response Number 9
Name: Xris
Date: December 10, 2003 at 23:00:10 Pacific
Reply:

Yeah, of course, C++ and javascript are completely different languages, even C and C++ are different and theorically it would be necessary to use two different compilers, but in the C and C++ case the C++ compiler also compiles C code.

With Java you need a different one, because the architecture of the compiler is completely different, C++ compilers generate machine code, but Java Compilers generate an intermediate code.

I dont use javascript so I dont know about that, but for sure you need a different tool

In which language are you writing?


0

Response Number 10
Name: Dr. Nick
Date: December 11, 2003 at 00:56:43 Pacific
Reply:

Right. C++ and Javascript are about as different as it can get.

Javascript does not use a compiler. It is a scripting language (Javascript). You just write the code in your HTML page between the <SCRIPT> and </SCRIPT> tags, no compiler needed.

Also note that Javascript has absolutely no link to Java.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Perl for Windows - CGI home network



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: help with c plusplus

Please help with c on bowling probl www.computing.net/answers/programming/please-help-with-c-on-bowling-probl/6979.html

Help with c programming! www.computing.net/answers/programming/help-with-c-programming/9893.html

Need help with C++? www.computing.net/answers/programming/need-help-with-c/4642.html