What is crtexe.c? Is it specific to the Visual Studio?

What is crtexe.c? Is it specific to the Visual Studio?
When the OS runs your compiled C++ program, the first line of main() isn't the very first instruction that gets executed.

There is a certain amount of work that needs to be done between the OS handing over control to your program, and it being ready to execute your code.

Some examples are
- getting the command line from the OS, and arranging it so it looks like an argc,argv[] that can be passed to your main()
- calling the constructors for any global objects (cin,cout,cerr are good examples).
- preparing for exceptions
- preparing for threads

All that pre-work is collectively your crtexe.c

> Is it specific to the Visual Studio?
Well it's specific to any particular compiler.
But in general, most hosted environments are going to have something similar in concept, even if not identical in name and function.
Topic archived. No new replies allowed.