javascript:tx('quote')
void family ()
{
string father;
string mother;
string kids;
int x;
int y=0;
int i=1;
char f[100];
cout <<"write the name of the father ";
cin >> father;
cout <<"write the name of the mother ";
cin >>mother;
cout <<"write the numbers of the kids";
cin >>x;
do
{
cout <<"write the kid name" ;
cin >> kids;
i++ ;
}
while (i<=x);
}
javascript:tx('quote')
how am i allowed to but the 3 strings father, mother and kids in a array?
#include<iostream>
#include<string> // add this
usingnamespace std;
void family ()
{
string father;
string mother;
//string kids; //remove this
int x;
int y=0;
int i=0;//change this
char f[100];
cout <<"write the name of the father ";
cin >> father;
cout <<"write the name of the mother ";
cin >>mother;
cout <<"write the numbers of the kids";
cin >>x;
string kids[x]; // add this
do
{
cout <<"write the kid name" ;
cin >> kids[i]; //change this
i++ ;
}
while (i<x); //change this
}