76 255
Assignments Done
Successfully Done
In May 2019

Answer to Question #8873 in C++ for eva

Question #8873
Hi, I am new to c++ and have a question. In my code I need to use a variable of my void fuction in my main. A simple example is

Void sendvariable (int x)
Int x=2


Int main ()

Want to get x from above function and do something on it

Expert's answer
You need to declare your function as int function and then return x back:

int sendvariable (){
& hellip;
return x;
Int main (){
& hellip;
int x = sendvariable ();
& hellip;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions