So, I am making a program. And by the start I've got an error. If I do this:
#include <stdio.h>
int k[5];
k[0] = 1;
int main ()
{
printf("hello world %d",k[0]);
}
I get the following errors:
4 [Warning] data definition has no type or storage class
4 [Warning] type defaults to 'int' in declaration of 'k'
4 [Error] conflicting types for 'k'
3 [Note] previous declaration of 'k' was here
4 [Error] invalid initializer
I can only think the problem is the compiler, because, well, an array is not that hard to use, I guess. Can anybody see what the problem is?