Variables | Sololearn: Learn to code for FREE!



As it is stated, I have an option to declare a variable and assign a value later. But I found it doesn't work in my compiler. So what has gone wrong?

2/25/2017 7:33:23 AM

Patrick Tan

5 Answers

New Answer


No its not necessary to include it in main function .Actually it should work !


Use Codeblocks IDE for C++.It is a very good tool. Hope it hels you!!


Nice ,All the best . Keep coding!!


should I include both declaration and assignment of value in the main function?


thank you very much ! I got it!