Array troubles

I'm having some problems creating arrays, anyone know what's wrong?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
		int check;
		//The while statement effects the value of check

		while (...)
		{
		...
		check++;
		}


		int marks [check];
		int marker = 0;
		int marker2 = 0;
		std::string fintest [check];
		std::string nfintest [check];


Errors:

error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'marks' : unknown size
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'fintest' : unknown size
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'nfintest' : unknown size


What's wrong >_<?
What it says. Static arrays must have a size known at compile time. If you need to decide it at run time, use dynamic memory.
Great, your going to make me read the one section I was avoiding >_<

Well, thanks hamster ^_^
Topic archived. No new replies allowed.