/*----------------------------------------------------------------------*/
/*                         Struct.cpp                                   */
/* Authored By : H.P.Kasmaei                                            */
/* Last Update : March 27, 2009                                         */
/* http://www.hpkclasses.ir/                                            */
/*----------------------------------------------------------------------*/
#include <iostream.h>

struct data{
   float amount;
   char fname[30];
   char lname[30];
} rec;

void print_rec(struct data x); // The function prototype

main(){
   cout << "Enter the donor's first and last names,\n";
   cout << "separated by a space: ";
   cin >> rec.fname >> rec.lname;
   cout << "\nEnter the donation amount: ";
   cin >> rec.amount;

   print_rec( rec ); // Call the display function.

   return 0;
}

/* function takes a structure of type data as its one argument
   and has no return value. */
void print_rec(struct data x) {
   cout << endl << x.fname << x.lname << " gave " << x.amount;
}

