Functions | Sololearn: Learn to code for FREE!

0

Functions

Every valid C++ program has at least one function - the main() function?

7 Answers

New Answer

+6

+3

Check my codes there is one which can run even without main(). Happy Coding.

+2

+1

can you really write computer software including databases with this course

+1

Yes. It's the core code of the program and it has to have a return value. I'ts like a car can't be a car without engine, or wheels.

+1

Technically compilers do provide some options to define a custom main function. Some engines and API's actually use this feature, for instance C/C++ programs that use the Windows API usually define WinMain as the entry point. Functionally there's no difference though. Every program needs an entry point (unless it's a library) and that entry function needs to have certain optional arguments depending on platform.

+1

Yes.the main() function is the core code of the program