I Right this?

Hi , i need to write a program that have an indefinited number of person with name, number of phone and all the call that they have do that can be 0 or 10000!
For every call i need to say the day and time, starting my program i've created a dinamic list and the program that acquires data:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
struct database{
	string nome;
	string numero;
	telefonate tel;
};
typedef database tipoValori;

struct elemento{
	tipoValori valore;
	elemento* next;
};
typedef elemento* lista;

//[...main...]

void acquisisci(lista &l){
	int x,z;
	tipoValori y;	
	cout << "Quante persone vuoi acquisire?\n";
	cin >> x;
	for(int i=0; i<x; i++){
		cout << "Inserisci nome e cognome: ";
		cin.ignore();
		getline(cin,y.nome);
		cout << "Inserisci numero di telefono: ";
		getline(cin,y.numero);
		cout << "Quante chiamate hai fatto?\n";
		cin >> z;
		for(int j=0; j<z; j++){
			j=j*z;
		}
		aggiungi(l,y);
	}
}

This work but now i need to add the call and i don' t know how do it, is 3 day that i search on web but I find nothing.
Can you help me?
Thanks

PS sorry for my bad english, i speak italian and you can see from code I think :D
I thought about this, but I do not think it is correct:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
struct telefonata{
	float giorno;
	float operatore;
	float durata;
};
struct telefonate{
	telefonata t;
	telefonate *next;
};
struct database{
	string nome;
	string numero;
	telefonate tel;
};
typedef database tipoValori;

struct elemento{
	tipoValori valore;
	elemento* next;
};
typedef elemento* lista;
It looks to me as though you'll want a class to represent a call. That class will need data members for:

- date
- time

You'll also want a class to represent a person. That class will need to have data members for:

- name
- telephone number
- list of calls

I don't speak Italian, but it looks as though that's close to what you have already.

It looks as though you're trying to write a linked list to store your calls, and your people. I'm not sure that's necessary - you can probably just use a vector.
Sorry, I can't use class, seem that the it seems that he wanted to track that I ran only one person and not many people, this makes it easier. I will post the code after thank you!
Topic archived. No new replies allowed.