User Profile

Collapse

Profile Sidebar

Collapse
Thiengineer
Thiengineer
Last Activity: Feb 5 '07, 06:00 AM
Joined: Feb 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thiengineer
    replied to How to swap pointers
    in C
    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;
    }
    See more | Go to post

    Leave a comment:


  • Thiengineer
    replied to printf / output questions in C
    in C
    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!
    See more | Go to post

    Leave a comment:


  • Thiengineer
    started a topic How to swap pointers
    in C

    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 =
    ...
    See more | Go to post

  • Thiengineer
    started a topic printf / output questions in C
    in C

    printf / output questions in C

    Given the following code in C:

    Code:
     char *s[] = {"program","test","load","frame","stack",NULL};
     char **p = s + 2;
    Questions:

    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));...
    See more | Go to post
No activity results to display
Show More
Working...