Date: Tue, 1 Apr 1997 18:47:29 -0600 (CST) From: Andrew Deren To: deltaman AT swipnet DOT se cc: DJGPP ML Subject: Re: String comparing problem In-Reply-To: <33417135.1856@geocities.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: QUOTED-PRINTABLE First you try to mix pascal with C. THe proper way to this is to use strcmp() function if (strcmp(one_string, other_string) =3D=3D 0) { printf("they are equal."); } BTW: By writing #197 do you mean extended ASCII character 197? Because that is the way you do it in pascal. On Tue, 1 Apr 1997, Deltaman wrote: > Hi! >=20 > Thanx to all for your help with my multiple file problem. Now I've got > another problem :) >=20 > I have a program to exchange special HTML-letters to plain text i.e > é to =E9=82 and so on. >=20 > In the beginner I set a string called 'test_string' >=20 > char test_string[5] ; >=20 > I do some other code that puts values into test_string character by > character. > I have a test line that prints the contents of a string to the screen. > Its output is: >=20 > from the lines: >=20 > printf(test_string); > printf("<--End of test string"); >=20 > I get the output: >=20 > #197; <--End of test string >=20 > When I checks if test_string is equal to a special character: >=20 > if (test_string =3D=3D "#197; ") printf("I should see this"); > if (test_string =3D=3D "#197;") printf("or this"); >=20 > ...nothing happens. >=20 > What do I do wrong? >=20 > Thanx in advance! > ------------------------------------------------------------------------ > mailto:deltaman AT swipnet DOT se >=20 > Please visit my homepage at http://www.geocities.com/TimesSquare/8240 > ------------------------------------------------------------------------ > ______ _______ _______ _______ _______ _______ __ _ > | \ |______ | | |_____| | | | |_____| | \ | > |_____/ |______ |_____ | | | | | | | | | \_| >=20 >=20