This is what I have so far...am I on the right track? Please help!!
void intpswap(int *xp, int *yp)
{
int t = *xp;
*xp = *yp;
*yp = t;
}
User Profile
Collapse
-
Thank you for all your help!
I now understand a-c, but still uncertain about part d.
I don't understand how there is a segmentation fault, if that is the case.
Can someone please explain what's going on on part d?
Thanks again!Leave a comment:
-
How to swap pointers
I don't know how to approach this problem, please help!
The following code is in main:
Code:main() { int x=1,y=2; int *xp,*yp; . . . xp = &x; yp = &y; intpswap(<arg1>,<arg2>); x=3;y=4; printf("*xp =
-
printf / output questions in C
Given the following code in C:
Code:char *s[] = {"program","test","load","frame","stack",NULL}; char **p = s + 2;
a) printf{"%s",p[-2] + 3);
b) printf("%c%s",* (s[1]),*p+1);
c) printf("%c%c%c% c", **s+1, *(*(p-1)+1), *(*s+3)+2, *(p[-1]+strlen(p[-1])-1));...
No activity results to display
Show More
Leave a comment: