Why my codes on pc said that the comad hello world in invalid to eject | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Why my codes on pc said that the comad hello world in invalid to eject

3rd Sep 2017, 7:39 AM
Juan Andrés Parra Amate
Juan Andrés Parra Amate - avatar
11 Answers
+ 7
There is nothing wrong with your code. Which compiler are you using on your desktop?
3rd Sep 2017, 8:09 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
@Kartikey That's why I'm asking about his compiler. If he is on Turbo C++, it is necessary for him to update to standard C++ instead of providing him with a solution which will make him think that it is fine to continue with an obsolete compiler.
3rd Sep 2017, 8:48 AM
Hatsy Rei
Hatsy Rei - avatar
+ 5
Just to clarify a few things here: return 0 doesn't need to be explicitly stated for main(). void return type for main has never been part of standard C++, and it never will be. http://www.stroustrup.com/bs_faq2.html#void-main
3rd Sep 2017, 8:45 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
Post your code @Juan so people can help
3rd Sep 2017, 7:41 AM
Ipang
+ 4
you need to add return 0 before last bracket or use void main in place of int main
3rd Sep 2017, 8:25 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 4
My sixth sense says that possibly he is using Turbo C++ 😂
3rd Sep 2017, 8:49 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 4
@Juan, can you tell us what is the IDE or compiler that you use for this? it's important.
3rd Sep 2017, 8:52 AM
Ipang
+ 3
@Rei void main will help if he is using Turbo C++.
3rd Sep 2017, 8:46 AM
Kartikey Sahu
Kartikey Sahu - avatar
0
#include <iostream> using namespace std; int main() {cout << "this" << "is" <<"awesome" ; }
3rd Sep 2017, 7:44 AM
Juan Andrés Parra Amate
Juan Andrés Parra Amate - avatar
0
its in my computer
3rd Sep 2017, 7:45 AM
Juan Andrés Parra Amate
Juan Andrés Parra Amate - avatar
0
please add "return 0" in main method. because the main method need return type too...
3rd Sep 2017, 7:56 AM
Zeron
Zeron - avatar