Search:

Type: Posts; User: surfxtc79

Search: Search took 0.00 seconds.

  1. Thread: more help

    by surfxtc79
    Replies
    7
    Views
    951

    im not looking for anyone to debug it...i just...

    im not looking for anyone to debug it...i just want someone to look over the syntax, etc, and make sure im allocating and releasing memory in the correct way
  2. Thread: more help

    by surfxtc79
    Replies
    7
    Views
    951

    my structure definition: struct mystruct {...

    my structure definition:


    struct mystruct
    {
    char *name;
    char id[10];
    int val;
    };
  3. Thread: more help

    by surfxtc79
    Replies
    7
    Views
    951

    this abridged version of the calls from main ...

    this abridged version of the calls from main


    .
    .
    .
    .
    int sel=0;
    char buf1[80],buf2[80],buf3[80];
    char *ret1;
  4. Thread: more help

    by surfxtc79
    Replies
    7
    Views
    951

    These are the functions that allocate and free...

    These are the functions that allocate and free memory:



    // Question 8
    void cop_setvals(struct mystruct *ps,char *name,const char *id,int val){
    ps->name=name;
    strcpy(ps->id,id);...
  5. Thread: more help

    by surfxtc79
    Replies
    7
    Views
    951

    more help

    Im having a problem when I try to free memory that has been previosly allocated. Ive checked to ensure the same address is being passed all the way through. I've attached the project and workspace...
  6. Replies
    4
    Views
    3,623

    thanks, everything is working fine now...the...

    thanks, everything is working fine now...the function is already prototyped in the header file...the variables are being read in from console window....sorry to leave out so much...the project is...
  7. Replies
    4
    Views
    3,623

    and the declaration should be: struct mystruct...

    and the declaration should be:
    struct mystruct *pdemo;

    in the main function
  8. Replies
    4
    Views
    3,623

    struct mystruct { char *name; char id[10];...

    struct mystruct
    {
    char *name;
    char id[10];
    int val;
    };
  9. Replies
    4
    Views
    3,623

    Allocating Memory for a Structure

    Im just learning C and I need help. Im trying to allocate memory for a structure call mystruct, initialize the values for the strucutre and then return a pointer to the allocated memory:

    void...
Results 1 to 9 of 9