Search:

Type: Posts; User: Tclausex

Search: Search took 0.02 seconds.

  1. Replies
    21
    Views
    2,731

    This student[j].first_name =...

    This


    student[j].first_name = malloc(sizeof(char) * MAX_CHARS_IN_NAME);
    student[j].last_name = malloc(sizeof(char) * MAX_CHARS_IN_NAME);


    is worse than this
  2. Replies
    21
    Views
    2,731

    Then do what we all do - get out a pencil and...

    Then do what we all do - get out a pencil and paper and diagram your data objects so can see what you have and/or what you want to have.

    You don't "need" pointers, you could just as viably have...
  3. Replies
    21
    Views
    2,731

    Why do you think you can treat student as an...

    Why do you think you can treat student as an array of structs


    fscanf(ifp, "%s", student[j].first_name);

    when you pointed it to an allocation for a single struct?


    person *student =...
Results 1 to 3 of 3