Help with struct and double pointer (code inside)

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2008
Posts: 376
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Help with struct and double pointer (code inside)

 
1
  #11
Nov 17th, 2008
It is only a pointer, don't worry. It's a pointer that points to pointers.

The struct declaration indeed only reserves one pointer, not an array or anything.

However, I guess you want to have *students in your struct. An "array" of students, right? That makes a bit more sense than what you have now (which resembles a 2D array of students).
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 38
Reputation: BigFormat is an unknown quantity at this point 
Solved Threads: 0
BigFormat BigFormat is offline Offline
Light Poster

Re: Help with struct and double pointer (code inside)

 
0
  #12
Nov 18th, 2008
Originally Posted by Clockowl View Post
It is only a pointer, don't worry. It's a pointer that points to pointers.

The struct declaration indeed only reserves one pointer, not an array or anything.

However, I guess you want to have *students in your struct. An "array" of students, right? That makes a bit more sense than what you have now (which resembles a 2D array of students).
Yes, if I've understood properly, for my purpose it's enough an "array of students", I only want to list the students in the school with their exams.
Now, I'm asking myself, why in the spec, that was given as a hint for implementaion, there's such a double pointer variable, is it somewhat better, for ex. more flexible or efficient?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 376
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Help with struct and double pointer (code inside)

 
0
  #13
Nov 18th, 2008
Not in any imaginable way if you ask me. Like I said, a pointer to an array of pointers (an array of "arrays") resembles a 2D array. Unless you want that, there's no use for a double pointer.

You can always create the double pointer at any time by &students, so if the need would arise it has a simple solution.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC