+ 1
can i use Twinkle() instead of main()?
5 Antworten
+ 3
#include<iostream>
using namespace std;
#define Twinkle main
int Twinkle() {
cout<<"Hello";
return 0;
}
run this code in g++ compiler
+ 1
Touché.
That's still main() once your code is compiled though.
+ 1
but i can write twinkle()
0
No, the function that your program execute first is always main(). You can have a Twinkle() function however.
0
You shall have a main function for a valid program but you can avoid its direct use by preprocessor macros.