Hi! I've try to make a small program that shows the error, but I still don't understand why this doesn't work.

If I have the code:
Code:
#include <stdio.h>


int main() {


	char genKey[10];


	return 0;
}
It works fine. But if I try to create a variable and initialize it to 10. Then Visual Studio complains.

Code:
#include <stdio.h>


int main() {


	int textLen = 10;
	char genKey[textLen];


	return 0;
}
I thought this meant the same thing, but it doesn't? Because the code in the second example doesn't compile.