home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.u.washington.edu!stein.u.washington.edu!bketcham
- From: bketcham@stein.u.washington.edu (Benjamin Ketcham)
- Newsgroups: comp.lang.c
- Subject: Re: adding strings together
- Message-ID: <1iab6dINNsq9@shelley.u.washington.edu>
- Date: 4 Jan 93 21:45:49 GMT
- Article-I.D.: shelley.1iab6dINNsq9
- References: <83017@mavenry.UUCP>
- Organization: University of Washington, Seattle
- Lines: 17
- NNTP-Posting-Host: stein.u.washington.edu
-
- In article <83017@mavenry.UUCP> nider@mavenry.UUCP writes:
- > can't you just add strings together with a +, like:
- >
- > string3=string1+string2
- >
-
- Can't you just read the FAQ before posting questions like this?
-
- It's illegal to perform addition on pointers. Even if it was legal,
- the result would not be what you are probably looking for. *string3
- would be garbage. You would have to use one of the string functions
- available, write one yourself, or use structures.
-
- That's one of the things I like about C. It doesn't let you "just"
- add two strings together, without realizing what you are doing.
-
- --ben
-