User Profile

Collapse

Profile Sidebar

Collapse
palidhjede
palidhjede
Last Activity: Feb 4 '10, 12:22 AM
Joined: Feb 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • palidhjede
    replied to malloc struct
    in C
    Thank you for the clarification, but I'm still unsure of the meaning of the double star **. As well I'm not sure how i would malloc one of the members of the struct. If you or someone could show me an example of mallocing a struct that is declared the way mine is (with the **) I would greatly appreciate it. Thanks for your time
    See more | Go to post

    Leave a comment:


  • palidhjede
    started a topic malloc struct
    in C

    malloc struct

    Hi I'm having difficulties trying to malloc a struct this is what it looks like and how I'm approaching the problem.

    Code:
    struct Records
    {
      char * fname;
      char * lname;
    };
    
    Records**   g_Recs; //Array of pointers
    
    
    void fakefunc()
    {
     g_Recs = (struct StudentRecords **) malloc (sizeof(struct StudentRecord*));
     g_Recs = (struct Records *) malloc (sizeof(struct
    ...
    See more | Go to post
No activity results to display
Show More
Working...