- 2

Hello World

What file do I create hello world under? It’s giving me errors about iostream and cout?

3rd Feb 2021, 4:07 PM
Jennifer
Jennifer - avatar
34 Antworten
+ 2
Post your code here
3rd Feb 2021, 6:28 PM
Abhishek Chauhan
Abhishek Chauhan - avatar
+ 3
its alright, I got the color coding to work, but still showing underlines.
3rd Feb 2021, 10:46 PM
Jennifer
Jennifer - avatar
+ 2
Show ur code Post it here
3rd Feb 2021, 4:09 PM
Abhay
Abhay - avatar
+ 2
#include <iostream> using namespace; int main() { cout << hello world!”; return 0; }
3rd Feb 2021, 4:21 PM
Jennifer
Jennifer - avatar
+ 2
its giving me errors when I do it on desktop.
3rd Feb 2021, 4:21 PM
Jennifer
Jennifer - avatar
+ 2
using namespace std;
3rd Feb 2021, 4:22 PM
Jennifer
Jennifer - avatar
+ 2
#include <iostream> using namespace std; int main() { cout <<"hello world"; return 0; } This is the correct code
3rd Feb 2021, 4:59 PM
Atul [Inactive]
+ 2
oh oops I actually had that, its still saying error. Sorrt must of typo’d in the chat.
3rd Feb 2021, 5:37 PM
Jennifer
Jennifer - avatar
+ 2
it underlines include and cout in red
3rd Feb 2021, 5:37 PM
Jennifer
Jennifer - avatar
+ 2
code provided by Atul (and following Aysha answer) correctly run: https://code.sololearn.com/cmoPF3NWRAt1/?ref=app Are you sure to write your code at the right place? (code playground could be configured for many languages, but doesn't try to detect them for you)...
3rd Feb 2021, 5:53 PM
visph
visph - avatar
+ 2
I dont know, I think its not in the right file type? what file type to use for desktop for this?
3rd Feb 2021, 8:57 PM
Jennifer
Jennifer - avatar
+ 2
are you trying to run your code on desktop, in sololearn web code playground, and/or in app' code playground?
3rd Feb 2021, 9:00 PM
visph
visph - avatar
+ 2
desktop, Im trying to follow on desktop as well.
3rd Feb 2021, 9:11 PM
Jennifer
Jennifer - avatar
+ 2
code works fine on SOLO
3rd Feb 2021, 9:11 PM
Jennifer
Jennifer - avatar
+ 2
are you using windows, apple or linux? it sounds like you're lacking developers sources ^^
3rd Feb 2021, 9:16 PM
visph
visph - avatar
+ 2
Windows, Im looking at a youtube video, gonna try it again.
3rd Feb 2021, 9:22 PM
Jennifer
Jennifer - avatar
+ 2
Im missing the actual C++ file directory? Not showing C++ file on New File.
3rd Feb 2021, 9:30 PM
Jennifer
Jennifer - avatar
+ 2
If you are on Windows, better to use an IDE.
3rd Feb 2021, 10:22 PM
Sonic
Sonic - avatar
+ 2
seems that my last reply was lost ^^ cannot help further with window :(
3rd Feb 2021, 10:28 PM
visph
visph - avatar
+ 2
Jennifer Use a better ide like codeblocks
3rd Feb 2021, 11:51 PM
Abhay
Abhay - avatar