Hello. My question is rather stupid but anyway: What are the ways so the main has access to the variable created in a function and vice-versa? Here the problem is of course that the variable "s" has not been declared.
Thank you guys very much. The tutorials that I was watching never mentioned what the return does. So what it does if I understood correctly is saying that the value "s" can be used and into the main. Right?
Another relevant question. If I want to return more than 1 values can I just write many times "return x;"?
No.
If you want to return many values, pass them in by reference, or pass in pointers to them, or return some kind of composite variable containing many sub-variables (like a struct), or return a container of variables.