Your
info
is a two dimensional array of
char
s where
info[index]
accesses an array of
NULL
terminated strings of type
char[]
resp.
char*
.
These are commonly called string pointers. When comparing these uing the
==
operator, you compare the pointers (the addresses). To compare the content (the strings), there is a C standard library function:
strcmp - C++ Reference[
^].
If you want to access characters from your
info
, you have to use two indexes:
info[string_index][char_index]
.
When
ap
is pointing to one of the strings in
info
, you can also use
ap[char_index]
or
*(ap + char_index)
. I suggest to use the first method because it is not so obscure as the second. The second from is used when there is no char index (just
*ap
); e.g. when incrementing the pointer within a loop.
So use
strcmp
to compare strings or do it in your own code by accessing characters as described above.