I've looked around and tried different syntax's for this but I can't seem to get it to work. I know this is elementary, but it's something that shouldn't take too long to figure out.
I have the character array...
char *roster[2][14] = {
{"13", "10", "24", "25", "15", "1", "00", "4", "11", "23", "22", "32", "3", "35"},
{"Isaiah Briscoe", "Jonny David", "EJ Floreal", "Dominique Hawkins", "Isaac Humphries", "Skal Labissiere", "Marcus Lee", "Charles Matthews", "Mychal Mulder", "Jamal Murray", "Alex Poythress", "Dillon Pulliam", "Tyler Ulis", "Derrick Willis"}
};
Then I'm generating a random element from that array...
random = rand() % 14;
printf("What is %s 's number?", roster[2][random]);
Then I try to print it out, but it fails...
printf("What is %s 's number?", roster[2][random]);
It outputs
What is (null) 's number?
and lldb shows that the printf statement jumps into...
libsystem_c.dylib`strlen:
-> 0x7fff9a596d32 <+18>: pcmpeqb (%rdi), %xmm0
0x7fff9a596d36 <+22>: pmovmskb %xmm0, %esi
0x7fff9a596d3a <+26>: andq $0xf, %rcx
0x7fff9a596d3e <+30>: orq $-0x1, %rax
randomis a well known system function name, defined in stdlib.h. It is a bad idea to declare a variable name the same as a system function name.