+ 2

How to pass variables in a function??

Like I wanted to make a function that would swap the values of the variables I pass to it. like. Void swap(a,b); And I want it to change the value of a and b without having to write any other command but the problem is that you can only pass the values to the function but not variables that it can manipulate How to solve this

2nd May 2019, 3:39 PM
Sajal Chuttani
Sajal Chuttani - avatar
7 ответов
+ 3
Thanks
2nd May 2019, 4:07 PM
Sajal Chuttani
Sajal Chuttani - avatar
+ 2
Nobody but i want to know how to do that please can you help
2nd May 2019, 3:45 PM
Sajal Chuttani
Sajal Chuttani - avatar
+ 2
No, but thanks for those two keywords thank you very much (where are you from)
2nd May 2019, 3:49 PM
Sajal Chuttani
Sajal Chuttani - avatar
0
Do swap(&a,&b), but first the swap most declared was void swap(int *a, int *b)
3rd May 2019, 12:46 AM
Werg Serium
Werg Serium - avatar