1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Returning *char problem

Discussion in 'C' started by danguba, Apr 10, 2008.

  1. danguba

    danguba New Member

    Joined:
    Apr 10, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello everybody... I'm new here. I have strange problem. My code look something like this

    char* point(transform z){
    char *a;
    ...
    //here goes some code where a gates some content
    ...
    printf("%s",a);
    return a;
    }
    void main()
    {
    ...
    // here goes some declarations that doesn't affect this problem
    ...
    char *p=point(y);
    printf(" %s ", p);
    }

    so first printf (where i print a) give good result but the second (where I print p) just write some strange symbol. I don't see any mistake in my code. Can anyone help?
     

Share This Page