Im trying to learn C++ for my next year at Uni, started using codeblocks to write in C and so was happy to keep using it for C++, but Im having an issue that I can't seem to find an answer to.
I bought the book, "Jumping into C++" and followed the instructions, opened up a new project and basically started from scratch again. Hello world works great! However when I build the second program, it comes up with an error telling me that there are multiple definitions of main, and that it's first defined in line 5 of hello.cpp
Ive tried renaming files but I havent got a clue what Im doing and I have no idea how to fix this......
hello.cpp
readnum.cppCode:#include <iostream>using namespace std; int main() { cout << "Hello World: \n"; }
Please help...Code:#include <iostream> using namespace std; int main() { int number; cout << "Please enter a number: "; cin >> number; cout << "You entered: " << number << "\n"; }