educative.io

Educative

Why it is wrong ... swap values using pointer

#include

using namespace std;

void swapVals(int * p,int *q){

// Write your code here

int * temp = p;

p=q;

q=temp;

}