how can i pass an array as an argument to the function?
in getCoin() fcn, I am supposed to pass coins array as an argument to the function. fcn prompts user to enter coin(Date, Type and Country). values entered
by user are read and assigned to the coins array.
Help is appreciated.
I tried the code below.
//# include "Coins.h";
#include <iostream>
#include <string>
using namespace std;
struct Coins
{
int date;
string type;
string country;
};
void getCoins(Coins & coins[], int SIZE);
int main()
{
const int SIZE = 10;
Coins coins;
//char choice;
//=============================================
/*OUTPUT:
There are 3 coins.
#1.)
Date: 1
Type: aa
Country: aa
#2.)
Date: 2
Type: bb
Country: bb
#3.)
Date: 3
Type: cc
Country: cc
Press any key to continue . . .
*/
//=============================================