It is giving right output but also giving error why ? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
15th Mar 2022, 3:57 PM
Abhay mishra
Abhay mishra - avatar
2 Réponses
+ 2
void main is no longer supportable in c /cpp you can use int main with return 0 or return EXIT_SUCCESS
15th Mar 2022, 4:09 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
hi Abhay not an error, it's just a warning, and you can run out of it by adding: #pragma GCC diagnostic ignored "-Wmain" this allows you to selectively enable or disable certain types of diagnostics, *or* simply you can just change the return type of the main function to int instead of void just like Raghuvanshi said..
15th Mar 2022, 4:14 PM
Amine Laaboudi
Amine Laaboudi - avatar