Hi, i try to make a simple Hello World program using string variable. I compile with Visual Studio 2008 via command prompt, but get an error. What is wrong here?
I know i can make it print Hello World more simple, but i was looking to see how "string" is working.
Note that i am completely new to programming, and if anybody sees an obvious error, i would appreciate an explanation.
No, you must include the libary string to be able declaring variables of type string. Yes, it is a standard libary, but (thanks god) not all the standard libary's are automaticly included
It will work fine. But if i don't include string and take away my cout. It still compiles fine. Meaning i can still use a string? But I won't be able to display it with the standard libary - unless i include string as well?
Yeah just as if include iostream and thats all and type std:: - in the intelsence i think its called in visual studio. string is one of the options that will come up. Thus why when i first used strings i was confused as hell why i could pull them up from the standard libary - but when i went to use them I'd have a nice big massive error lol