Let f be the following C++ function: void f (char *p) { char *q = p; while
Fantastic news! We've Found the answer you've been seeking!
Question:
void f (char *p)
{
char *q = p;
while (*q)
q++;
while (p < q) {
char ch = *p;
*p++ = *--q
*q = ch;
}
}
Assume that the argument to f is C-style (null-terminated)string.
A) What modification does f perform to the string that ispassed to it?
B) Explain how f works.
Related Book For
Finite Mathematics and Its Applications
ISBN: 978-0134768632
12th edition
Authors: Larry J. Goldstein, David I. Schneider, Martha J. Siegel, Steven Hair
Posted Date: