I have installed devc++ and written a basic hello world program
#include<stdio.h>
int main
{
cout<<"hello";
return 0;
}
It is my run. However I am getting the following errors while running the code
3 1 D:\cpp\helloworld.cpp [Warning] extended initializer lists only
available with -std=c++11 or -std=gnu++11
4 4 D:\cpp\helloworld.cpp [Error] 'cout' was not declared in this scope
5 4 D:\cpp\helloworld.cpp [Error] expected unqualified-id before
'return'
6 1 D:\cpp\helloworld.cpp [Error] expected declaration before '}' token
Someone please help !
In your first line of code, you use
#include<stdio.h>
which is a c preprocessor directive, but in main function you usecout<<"hello";
which is a C++ code.For a C code, you need to use something like this:
And in the C++ (Read at C++ Language), you need to use something like:
Or