Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

int32_t main() vs int main()

I've written a cpp program, and I am able to run it with int32_t main() but not with the signature int main().

Can someone tell me why? Its a .cpp file and not a .c file (as mentioned in some other questions).

like image 642
Keshav Agrawal Avatar asked Aug 24 '20 08:08

Keshav Agrawal


Video Answer


1 Answers

The possible explanation could be that one of your #include files at the top redefines int as something else. This may happen if somebody tried to change the data type in some algorithm by simply redefining int.

Try to put #undef int into a line line immediately before the int main() to restore the default meaning of "int".

like image 189
Audrius Meškauskas Avatar answered Nov 14 '22 23:11

Audrius Meškauskas