+ 2
Can we reassign the variable values in main() function by using the user defined function (return type || void )? In C
Without using pointers and global variable...
8 Respuestas
+ 2
Didn't get the "reassign the values in main()" here, did you mean change local variables in main() function?
+ 2
Yes Ipang, how to change local variable in main () function using user defined function...
+ 2
It means pointer useful for void function to reassign the local variables?
Am I right codemonkey ?
+ 2
Thank you so much codemonkey 🙌
+ 2
I wrote this simple program for you to show that it is possible to change variables in main() from a void function without passing pointers or global variables.
Please, never do this!!!
https://code.sololearn.com/c7vF6GzfXama/?ref=app
+ 1
codemonkey, I found that your code reassign the local variable using user defined function[return type]....
Then what is the use of pointer function....? To reassign the local variables in main() function.....
is pointer function used for void return type function to reassign the local variable? am I right ?
+ 1
Thank you everyone for solving my queries😊🙏
+ 1
Martin Taylor why we are using void inside the main function?
i.e int main(void);😅
What is the use of it...