User Profile

Collapse

Profile Sidebar

Collapse
Ying
Ying
Last Activity: Oct 11 '06, 06:47 AM
Joined: Oct 11 '06
Location: Bangkok
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ying
    replied to Need helps on an array of pointers to structure
    in C
    It tried what you suggested, but it doesn't work.
    It still said the floating point doesn't linked for

    scanf("%f", &rec[0]->mark);

    but it works fine for

    scanf("%s", &rec[0]->name);

    This is so strange. Huh!...
    See more | Go to post

    Leave a comment:


  • Ying
    started a topic Need helps on an array of pointers to structure
    in C

    Need helps on an array of pointers to structure

    I have problems to access a member in an array of pointers to structure.
    I declare the following structure

    struct {
    char name[80];
    float mark;
    }*rec[10];

    I would like to put data to rec[0]. So I use following codes

    gets(rec[0]->name);
    scanf("%f", rec[0]->mark);

    the gets command is working fine, But the command for rec[0]->mark...
    See more | Go to post
No activity results to display
Show More
Working...