I desperately need help right now, I'm stuck for days in C language where you need to type the words that will appear, its a memory game, i don't know how toput the words. then reccognize the words whether its correct or not. thank you guys very much in advance. something like this.
1 2
array[10][]={"cat","dog","rat","fish","cow","sheep",[etc]};
/*they will be automatic inputted then you must type them correctly to get points.*/
The first [] may be remain emptied because it can count by how many member in the array
but the second one shouldn't be because it's tells how long the maximum string size is.
I strange thought that you are stuck with this for days. If I am still very new just like you, I would probably hack and slash programming ( try everything and hope it works but don't really know why something works ).
I am hoping I am giving the correct answer because I never coded in C lang before just C++.
There is a problem in char names[][10] = {"Tyrannosaurus rex", "cat"};
We state that each row of table names has 10 characters, but attempt to initialize the first row with 18.
However, the OP apparently does not need mutable words. constchar* names[] = {"Tyrannosaurus rex", "cat"};
Now names is just a list of pointers, which point to const string literals.
The OP does need mutable character array(s) for the words that the user will give.
@keskiverto oh thanks for that, array is confusing. now i've got another problem. im stuck in the scanf, i cant get the proper formula for getting that.