+ 2
can anyone explain about this warning? [SOLVED]
I have made a c program in which I get some warnings after output please explain it because I can't understand . And why I can't use void main() instead of int main() in SL. https://code.sololearn.com/cIDBQWGWMn6l/?ref=app https://www.sololearn.com/post/246721/?ref=app
4 Réponses
+ 4
As far as void main() query is concerned then generally in morden day compilers, Return type of main() is used as exit code of the program (zero means program executed without any errors).
So main has to return an integer hence int main()
+ 3
See this code. You need initialize your variable.
https://code.sololearn.com/c0hSwvvRwIz0/?ref=app
+ 2
Vaibhav
You are trying to display 'c' before geting input from user so 'c' is an uninitialised variable here
check this out👇
https://code.sololearn.com/clCnVs2wYcM6/?ref=app
+ 2
Solved , thanks