No u can't do a program without main function.When u compile the program u will not get any error message.But when u run the program the compiler will serach for the main function to be executed first.At that time u will get a error message.As your program may contain many functions the compiler will first search for the main function inorder to avoid the confusion as which function must be called first.
>can u do a c++ program without main function.....?
It's splitting hairs, but yes, you can if your compiler supports alternative entry points. For example, Microsoft's CL compiler supports WinMain as an entry point instead of main.
Use entry as the explicit symbol for beginning execution of your
program, rather than the default entry point. If there is no
symbol named entry, the linker will try to parse entry as a number,
and use that as the entry address (the number will be interpreted
in base 10; you may use a leading 0x for base 16, or a leading 0
for base 8).
I hadn't actually tried to compile it, but it does use some preprocessor directives to change the InfernoDevelopment() into main(). So, there is still a main() once the program compiles, it's just obfuscated in the source, so bravo to pradeep. However, this could have been 100x better if he/she offered some explanation and wasn't shamelessly self promoting.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...