Hi, i want to assign an array inside a structure this is the code:
Code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main() {
struct print {
char *head[6];
};
struct print omino;
omino.head[0] = " __________________\n";
omino.head[1] = " | \\ _______\n";
omino.head[2] = " | \\ | |\n";
omino.head[3] = " | \\ | |\n";
omino.head[4] = " | \\| |\n";
omino.head[5] = " | |_______|\n";
int i;
for( i = 0; i < 6; i++ ) printf("%s", omino.head[i]);
}
this works, but if i want to assign the array like:
Code:
omino.head[] = { "string" ... }
i get syntax error.