How to Call a Function With Multiple Pointer Arguements

Hello. In my code, I have a function like such: int function1(int* a, int* b). I am wondering how to call it in int main.Any help would be appreciated. Thank you!
1
2
3
4
5
6
int main(){
int a, b; 
function1(a, b);

return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

void swap(int* a, int* b)
{
    int tmp = *a;
    *a = *b;
    *b = tmp;
}

int main()
{
    int a, b;
    std::cout << "Please enter 2 numbers: ";
    std::cin >> a >> b;

    swap(&a, &b);
 
    std::cout << a << " : " << b << std::endl;
    return 0;
}    
Thank you much, but kbw in my program, I have it like such:
Int Function1(int*var1,int* var2)
{Blah}
Int Function2(int randomvar)
{
Int a ;
Int b ;
Function1(&a,&b) ;
}
I solved the problem by calling the second function( function2 ) like this in int main: function2(0) ; that made it work properly because of the function1(&var...). Thank you everyone!
Topic archived. No new replies allowed.