How to get inputs for a global variable in the global part of the function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to get inputs for a global variable in the global part of the function?

is it possible to get the inputs like that or not

2nd Aug 2017, 1:31 PM
santhosh kumar
santhosh kumar - avatar
3 Answers
+ 6
Outside of the functions you can't write cin to make the user input.
2nd Aug 2017, 2:17 PM
Umbe
Umbe - avatar
+ 8
What do you mean by global part of the function. Inside a function outside main, or just outside main?
2nd Aug 2017, 1:56 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
just out side main
2nd Aug 2017, 3:29 PM
santhosh kumar
santhosh kumar - avatar