Skip to content

Instantly share code, notes, and snippets.

@Elv13
Created October 14, 2011 00:28
Show Gist options
  • Save Elv13/1285912 to your computer and use it in GitHub Desktop.
Save Elv13/1285912 to your computer and use it in GitHub Desktop.
/*My friend like to cheat*/
char** futureLovers = {
"BETTY F M A A C C",
"TOM M F A D C A",
"SUE F M D D D D",
"ELLEN F M A A C A",
"JOE M F A A C A",
"ED M F A D D A",
"SALLY F M C D A B",
"MARGE F M A A C C"
}
static const unsigned int numberOfLovers = 8;
char** name = malloc(numberOfLovers * sizeof char*);
char** info = malloc(numberOfLovers * sizeof char*);
for (unsigned int i =0; i < numberOfLovers; i++) {
unsigned int j = 0;
while (numberOfLovers[i][j] != ' ' || numberOfLovers[i][j] != 0x00) j++;
numberOfLovers[i][j] = 0x00;
name[i] = numberOfLovers[i];
info[i] = numberOfLovers[i][j+1];
char field1 = info[i][0];
char field2 = info[i][2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment