Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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?

here is the line that say I have an unterminated character constant
document.write('<layer name="nsdate'+i+'" top=0 left=0 height='+a+'

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.

sixpack:
Try
document.write("<layer name="nsdate'+i+'"
top=0 left=0 height='+a+'");is "document" a class constructor?
MYXP

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

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

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

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?

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?

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.

![]() |
Perl for Windows - CGI
|
home network
|

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