I have just started learning C++ in Visual Studio code but for some reason, it is showing error but when I tried the same program on Devc++ I was able to get the desired output.
MY PROGRAM my program
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello world";
return 0;
}
This is the error that is flashing in the output:
ERROR:error error contd
[Running] cd "c:\Users\Swastik\Documents\c++" && g++ helloworld.cpp -o helloworld && "c:\Users\Swastik\Documents\c++"helloworld C:/Program Files/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status
[Done] exited with code=1 in 3.226 seconds