Date: Mon, 23 Feb 1998 19:05:13 -0800 (PST) Message-Id: <199802240305.TAA28156@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Nils Emil P. Larsen" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Some easy questions (for you!) Precedence: bulk At 10:00 2/23/1998 +0100, Nils Emil P. Larsen wrote: >Thank you for DJGPP! > >I need some help for working with strings: > >- How do I add a string to the end of another: > e.g. Str1 = "Thank "; Str2 = " you!"; > Str3 = ???(Str1, Str2) /* Str3 must be: "Thank you!". What is ??? */ You want the function `strcat', but its workings are somewhat different from this. See its docs, and below. > >- How do I convert between strings and numbers? I want to use it like that: > Str1 = "Birthday: " + Int1 /* Str1 must be "Birthday: (value of int1)" */ > OR > Int1 = Str1 /* Int1 must contain the number in Str1 */ The best ways are probably `sprintf' for number-to-string, and the `strtol' family for the reverse. See docs. > >- Where can I get help for beginners in DJGPP? I don't think any of my >DJGPP-FAQ's contain info for people who don't know C. Especially are I >searching for help on the keywords (for, do...while, if...then...else ....). The best solution is to get a book. I have heard good things about "The C Programming Language, Second Edition" by Kerninghan and Ritchie. Look for one that describes ANSI C, and not some specific compiler (i.e. Borland, M$). Avoid like the plague any book whose title contains the words "Dummy" or "Idiot". Standard C questions like this really belong on the comp.lang.c newsgroup, so that's another resource. Be sure to read its FAQ! Incidentally, it's probably impolite to mail questions directly to DJ. Posting to the newsgroup/list is a better approach. Nate Eldredge eldredge AT ap DOT net