0

Ok I am in the process of making a simple hangman game. I need help pulling a string which is in an array dict[num] num being a random number. I just need a way to get that string out and use strlen() and such functions to work with it.

As of now strlen(dict[num]) does not work?

Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
Zack Tarr
  • 851
  • 1
  • 8
  • 28

1 Answers1

1

if the type of the dict array is char then to get the length

strlen(dict)

and not

strlen(dict[num])

and if the

strlen(dict)

gives segmentation error then chek that your array is filled with string I mean check the string in the array end with the null character '\0'

MOHAMED
  • 41,599
  • 58
  • 163
  • 268