C prog: printing values from array of structures

In summary: When you pass them by value you will not pass a pointer to an array, you will pass an individual object (note: object is bad choice of word :P). The only way this can be achieved is by calling the function print_names as many times as the array is large.
  • #36
HOLY COW! IT'S WORKING! Here's the function.

void print_names(struct pers_info record)
{
printf("%s -- %s \n", record.pers_name.last, record.ssn);
}
 
Computer science news on Phys.org
  • #37
Thank You! :biggrin: :biggrin: :biggrin:

This the output:

Adams -- 123456123
Burke -- 623001200
Cooper -- 423456999
Dodd -- 327856909
Eggwhite -- 563456929
Press any key to continue
 

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
753
  • Programming and Computer Science
Replies
29
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
925
  • Engineering and Comp Sci Homework Help
Replies
18
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Programming and Computer Science
Replies
22
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top