setting up a 2d array - returning error

I am trying to setup a 2D array, but i keep getting this as a result



(13)error C2087: 'abstract declarator' : missing subscript
(19)error C2660: 'setUpSeatChart' : function does not take 2 arguments
ASSN4 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

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
//File Name: ASSN4.cpp

#include<iostream>
#include<fstream>
#include<conio.h>
#include<string>
#include<iomanip>
#include<cctype>
using namespace std;
#define in_file "data.txt"
#define out_file "result.txt"

void setUpSeatChart (char [][]);
void getSeatPrice (int&);
void upDateSeatChart (char[], char[]);
void main()
{
	char chart[15][30];
	setUpSeatChart(chart);
	getch();
}

void setUpSeatChart (char x[][30],)
{
	for (int r = 0; r < 15; r++)
		for (int c = 0; c < 30; c++)
			x[r][c] = 'o';
	cout << "123456789012345678901234567890" << endl;
	for (int r = 0; r < 15; r++)
		for (int c = 0; c < 30; c++)			cout << x[r][c] << endl;
	cout << "Legend: o = open seat" << endl;
	cout << setw(8) << "c = closed seat" << endl;
}


Last edited on
Modify the declaration as well to
void setUpSeatChart (char [][30]);
And remove the comma at line 23
Topic archived. No new replies allowed.