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).
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).
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".
© 2022 - 2024 — McMap. All rights reserved.
int32_t main() {}
vsint main() {}
? I mean, with an emptymain
. – Involuntaryint32_t main() {}
&int main()
both seems to be working fine on OnlineGDB. You need to add more information to your question by editing it. – Affined#define int
statement in an included file which was causing this error. – Reductive