hi, I started c++ not long ago and I did 2 files in 1 project.
now I know main(); will always be execute first but how do I execute only the submain();?(my other function of the file)?
pls help?
P.S.: how do I use the goto command?
hi, I started c++ not long ago and I did 2 files in 1 project.
now I know main(); will always be execute first but how do I execute only the submain();?(my other function of the file)?
pls help?
P.S.: how do I use the goto command?
I don't think it's possible to run a program without Main being called, could be wrong.
Ubuntu Linux / Vista Home Premium (for games)
SCiTE text editor, G++ compiler
You call it from main().now I know main(); will always be execute first but how do I execute only the submain();?(my other function of the file)?
With great skill, or not at allP.S.: how do I use the goto command?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Hehe great answer laserlight
Goto is in C++ and is a "label" selection structure. But, in all honesty, like laserlight said, it should be avoided in all cases excpet in extreme circumstances, ( getting out of a deeply nested for loop structure could be one ).
Double Helix STL
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.