FYI, I'm new to programming. When I try to compile this code it gives error saying:
[Warning] non-static data member initializers only available with -std=c++11 or -std=gnu++11
[Error] initializer-string for array of chars is too long [-fpermissive]
I have searched a lot but all of the articles use this exact method. Can anyone explain why am I getting this error? Explain in language I can understand. I didn't understand most of the answers and reasons stated.
#include <stdio.h>
struct person{
char name[] = "something";
};
int main(){
struct person per;
printf("%s",per.name);
}