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

Replies
3
Views
1K
Replies
4
Views
1K
Replies
29
Views
2K
Replies
9
Views
2K
Replies
3
Views
1K
Replies
22
Views
3K
Replies
21
Views
2K
Replies
1
Views
3K
Replies
1
Views
1K
Back
Top