Swapping strings by copying and swapping strings by using pointers?

i was solving a problem on hackerrank, it failed 3 test cases when i swapped the strings by using a temporary char array. but when i swapped them by using a char type pointer, it worked perfectly.

i remember that some issue is there in using a temporary string… please tellme

Hi raghav
Could you please elaborate your question using some examples?

HI @sirraghavgupta, are you referring to memory leak ?

no replies to the question. so i am leaving this and marking resolved.