+ 2
Why is this c++ code not working .
This code runs very well in turbo c++ And not running in this solo learn plaground why is it so. Please help me if I am misunderstanding some concepts. https://code.sololearn.com/cTVqYQkKC0S8/?ref=app
16 Respuestas
+ 5
Problems:
You are using a very old compiler.
C++ is regularly updated. Sololearn support the modern version of C++.
The return type of main must be int.
+ 3
~ swim ~ it would tell me mine java version which I upgrade regularly but what is taught in schools is unknown
+ 3
I have also studied c++ in school and was also confused. I think you should learn latest c++ code in school just replace some part of program.
Add .h at end of header file
Remove using namespace std;
Use void main and don't return 0
This you have to do in school.
+ 2
You are writing code in a very very old compiler.
C++ is regularly updated with enhanced features. In Solo learn we have write a latest c++ 11 / 14 /17 code i.e.
#include<iostream>
using namespace std;
int main()
{
cout<<"hello everyone ....";
return 0;
}
For more information go to the course in Solo learn.
+ 2
Abhinav Bhardwaj i have gone through the courses in sololearn but i got confused when i saw these programs and one which was taught in my school
+ 2
Abhinav Bhardwaj thank you for your explanation but I have one more doubt can we use void in main
+ 2
this program can work in turbo because according to new cpp main have integer return type not void and conio is non standard library which present only in turbo compiler.
change these things and then your program works
+ 1
may be cause it is accepted by our school's board but now it's all java in our syllabus c++ was initial language ~ swim ~
+ 1
~ swim ~ what is meant by the version ?? jdk version??
+ 1
~ swim ~ well I am not quite sure which is the version as we are used to with blueJ as our IDE and I am not sure which version we are taught
0
It's obvious; cuz you deleted the code "using namespace std;" and didn't add "std :: " before the "cout" method.