little addition to my program

Im still new to programing so i need a little help
first this is my program
i want to create a new function that can print the informations written in the first function
'code'
#include "stdafx.h"
#include "iostream"
#include "string"
using namespace std;
void family ()
{
int x;
int y=0;
int n;
int c=1;
int a;
int j;
int q=0;
string f[100];
cout<<"how many families you want to insert ";
cin >> n;
for (int j=1;j<=n;j++)
{

cout <<"write the name of the father ";
cin >> f[y] ;
y++;
cout <<"write the name of the mother ";
cin >> f[y] ;
y++;
cout <<"write the numbers of the kids ";
cin >>x;
for (int i=1 ; i<=x ; i++)
{
cout <<"write the kid name " ;
cin >> f[y];
y++;
}
q=q+10;
y=q;
}
}
int main ()
{
int x;
cout<<"press 1 to insert a complete family \n ";
cin>>x;
if (x==1)
{
family();
}

system("pause");
return 0;
}
'code'
Last edited on
Topic archived. No new replies allowed.