I want to parse a user-input (using scanf) in 2 separate arrays. g++ compiles without error, but I get a memory-access-error (core dumped). (in german: "Speicherzugriffsfehler (Speicherabzug geschrieben)")
char *top[10];
char *bottom[10];
for(i = 0; i < 5; i++){
printf("Karte %d: Obere Werte? ", i );
scanf( "%s", top[i] );
printf( "Karte %d: Untere Werte? ", i);
scanf( "%s", bottom[i] );
}
What's the problem here? I tried using "stringcpy" with a temp-var ("stringcpy(top[i], temp)"), but it didn't work either.
Any suggestions?