
Write a function that exchanges the two char * pointers held at two addresses, without touching a single character of either string.
a = "alpha", b = "beta", swap_str(&a, &b)a=[beta] b=[alpha]a = "", b = "cargo build --release", swap_str(&a, &b)a=[cargo build --release] b=[]a points at one[] = "alpha", b points at two[] = "beta", swap_str(&a, &b)one=[alpha] two=[beta] a=[beta] b=[alpha]a = "git bisect", swap_str(&a, &a)a=[git bisect]b = "make -j8", swap_str(NULL, &b)b=[make -j8]swap_str.c<stddef.h>defines NULL
Run the tests to grade your code
Write a function that exchanges the two char * pointers held at two addresses, without touching a single character of either string.
a = "alpha", b = "beta", swap_str(&a, &b)a=[beta] b=[alpha]a = "", b = "cargo build --release", swap_str(&a, &b)a=[cargo build --release] b=[]a points at one[] = "alpha", b points at two[] = "beta", swap_str(&a, &b)one=[alpha] two=[beta] a=[beta] b=[alpha]a = "git bisect", swap_str(&a, &a)a=[git bisect]b = "make -j8", swap_str(NULL, &b)b=[make -j8]swap_str.c<stddef.h>defines NULL
Run the tests to grade your code
Memory will appear here