Message-ID: <3BB570FD.F7B78997@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Please add strrev proposal References: <3BB50884 DOT 347A4384 AT yahoo DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 31 Date: Sat, 29 Sep 2001 07:05:19 GMT NNTP-Posting-Host: 12.90.168.197 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1001747119 12.90.168.197 (Sat, 29 Sep 2001 07:05:19 GMT) NNTP-Posting-Date: Sat, 29 Sep 2001 07:05:19 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "A. Sinan Unur" wrote: > > CBFalconer wrote in > news:3BB50884 DOT 347A4384 AT yahoo DOT com: > > > Thank you. I knew there was a reason I made my equivalent > > (revstring) a void function. I just didn't know what it was :-) > > The usefulness of a strrev function depends very much on what you intend to > use it for. For example, if your program is looking for palindromes, you > might want to use something like: > > strcmp(word, strrev(word)); > which has precisely the undefined action you illustrated earlier. With it returning void you are forced to write something like: strcpy(temp, word); strrev(word) if (strcmp(word, temp)) palindrome(); but you would be better off modifying strrev to do it all in one scan, and calling it: bool ispalindrome(char *word); -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)