Posted by mgb@xxx.xx-xxx.xx.xx (BRASIER Matthew G) on 1999-04-26
If you are given a string in c, it is pretty safe to assume it is null terminated, (it will be if you get it with proper I.O. fuctions. You can therefore go through the string till you get to the null character /0 at the end, and keep track of how far you have gone. Also when comparing strings remember that the ones you read from a dictionary may have carriage returns on them, so strip these off if they exist. And remember not to include the null character in your reversal. I think there is a function in C called strlen(char*) which returns the length of a string, but i dont know if it includes the last /0 dIZZY
Previous post | Next post | Timeline | Home