C++ 'Too many characters in constant'

TitanMATRIX

In Runtime
Messages
202
I dont understand this. I have C++ 2008 Express edition and I keep running into this compilier error of 'Too many characters in constant.'

I tried to do even the simplest "helloworld" program and it still doesn't work. I am on another computer and it works but for some reason its not wanting to work on my laptop but here is what I'm working with...


#include "stdafx.h"

#include <iostream>

int main ()

{
using namespace std;
cout << 'Hello World' << endl;
return 0;
}

This is so easy yet for some reason it won't compile... am I not seeing something here?
 
You're putting single quotes round a string, which the compiler is most likely trying to interpret as a single character. Try replacing them with double quotes :)

EDIT: Damn, beaten to it, just!
 
Back
Top Bottom