Im useing dev C++ and im currently trying to teach myself c++ with this websites help. I try useing the sample codes and i get multiple definition of 'main' errors...i copy and paste and ive typed it out...any help on this?
Printable View
Im useing dev C++ and im currently trying to teach myself c++ with this websites help. I try useing the sample codes and i get multiple definition of 'main' errors...i copy and paste and ive typed it out...any help on this?
nevermind
Just make sure you never type "void main" please. Use "int main" if you see any sites using "void main". Just because the sites use it in their examples doesn't mean it's a good thing.
No, but seeing as so many tutorials or stuff use void main, it can be good info.
Many tutorials dont give the "complete" code,for example if they want to teach you loops,they will just write:Quote:
....i copy and paste...
If you copy-paste these kind of things,obviously you will get errors.So include all the necessary header files,and paste the code in int main()Code:for(i=0;i<10;i++)
{
i+=1;
}