+ 1
Using a function in Main
I have a public non parameter function set up under my class. If I want to call the function in main what is and is not allowed ? Can I reuse same variable names and initialize them in main ? Thanks
1 Respuesta
+ 1
In which language? Pls tag language also..
In c++:
You can call those functions through objects..
Variables declared in a function are local variables, their scope is limited to function. Not available outside function. So you can declare with same name in main also..
It is better try it on playground and share that part of code if any error you get.. That makes easy for you to get your required answer..
Hoping it helps you..