Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
can i use Twinkle() instead of main()?
5 Respostas
+ 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.