I am creating a snakes and ladders game and i want to create the snakes and ladders as strings first to distinguish between them! My board is a 2d char Array and i dont want to change that as my whole program is based on that! If anyone could help it would great.
See im not sure what the difference is between char* and char
but the reason i want to do it this way is so i can have it easy for the user to see which snake/Ladder is which and using characters i cant have more than 1 character!!
I want it like S1 (start of snake)
s1(End of snake)
char is a character type (Something like 'x', 'S', 'n' and others) and can hold a single character (it cahhot contain "s1" since it is 2 (actually 3) characters). char* is a pointer type. It points to memory area where char is located. The difference is the same as note with address vs building. You have two choices:
a) Use single characters.
b) Change array type.
Note: if you will change array type you should not use c-strings. They are evil and probably lead to different kind of errrors.