Search code examples
c++signatureint32

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).


Solution

  • 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".