-
I know I'm going off-topic but using dumb and long algorithms like the ones you use only make it easier for you to commit mistakes. Besides, I really think you don't understand the concept of arrays, pointers and loops. You could have your ID variable be an array and store all the values... yet that would be completely useless... Why don't you use teams[print].player_array[i] ? Here's what you could do if you really don't want to type teams[print].player_array[i] ...
Code:
PlayerInfo* p = teams[print].player_array;
for(int i = 0; i < teams[print].noPlayers; i++)
printf("Player %d: %d\n", i, *(p + i));
Coding the way you are right now, you will never be able to code any program larger than basic console programs. When you get to write OpenGL game, will you hard-code every single pixel instead of using the right tools ? Do you realize I have just written in 3 lines what you coded in over 30 lines ? You're writing 10 times too much code.
-
I know that my code is long. I get that. I don't spend all my time doing this. I am doing this in my spare time. I do not wish to become a programmer. I said that I was going to go back over it once I have it working to shorten it...its just something I am doing to relax. :|
-
I'm doing this for fun as well.
-
Ok, the only thing that is not working with the code you suggested was initial and surname search....its not liking them
-
I've got the initial search to work, but it doesn't like the surname. It wont let me do this:
players[print].familyName[0];
I can do: players[print].familyName
and say, print the entire surname, but it wont look at just one character
-
Its ok, I forgot to use strncmp