strucutres problem...need advice

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
35
36
37
38
39
40
41
42
43
44
45
46
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;

struct Bureau
{ 
	char Name[15];
	int TelephoneNumber;
	char SpeakingTopic[40];
	double FeeRequired;
};

int main()
{
	const int SIZE = 3;
	
	int speakers;
	
	cout << "How many speakers need to be reserved? ";
	cin >> speakers;
	
	Bureau *bureaus;
	bureaus = new Bureau[SIZE];

	cout << "\nPlease enter the data for each speakers. " << endl;
	cout << "----------------------------------------" << endl;
		
	for ( int i = 0; i < SIZE; i++ )
	{
		cout << "\nEnter the data for speaker's #" << ( i + 1 ) << " name: ";
		cin >> bureaus[i].Name;

		cout << "\nEnter the telephone number for speaker's #" << ( i + 1 ) " :";
		cin >> bureaus[i].TelephoneNumber;

		cout << "\nEnter the speaking topic for speaker's #" << ( i + 1 ) " :";
		cin >> bureaus[i].SpeakingTopic;

		cout << "\nEnter the required fee for speaker's #" << ( i + 1 ) " :";
		cin >> bureaus[i].FeeRequired;

	}
	
	return 0;
}
Last edited on
You forgot a << in those last three couts.
Last edited on
still do not work because this \n is a newline
thank you it works now
Topic archived. No new replies allowed.