home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!europa.asd.contel.com!emory!swrinde!sdd.hp.com!think.com!enterpoop.mit.edu!ira.uka.de!math.fu-berlin.de!news.th-darmstadt.de!rbg.informatik.th-darmstadt.de!misar
- From: misar@rbg.informatik.th-darmstadt.de (walter misar)
- Subject: Re: how to I continue a long string on the next line of code?
- Sender: news@news.th-darmstadt.de (The News System)
- Message-ID: <1992Dec11.185441@rbg.informatik.th-darmstadt.de>
- Date: Fri, 11 Dec 1992 17:54:41 GMT
- References: <EJH.92Dec10105245@khonshu.colorado.edu>
- Nntp-Posting-Host: rbhp58.rbg.informatik.th-darmstadt.de
- Organization: TU Darmstadt
- Lines: 33
-
- In article <EJH.92Dec10105245@khonshu.colorado.edu>, ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
- >
- > I'm writing a function with a bunch of lines like this:
- >
- > fprintf(fp,"Lat: %d Long: %d sza: %d elev: %d skin temp: %d model pressure: %d",
- > s.lat,s.lon,s.sza,s.elev,s.modpres);
- > fprintf(fp,"icc: %d retrieval method: %d sdll: %d sdml: %d n: %d box: %d flag: %d",
- > s.icc,s.retmeth,s.;
- >
- > This is fine on my big old Sun screen, but when I'm working on a text
- > terminal, or from home, these lines will wrap in an annoying way. I
- > want to continue them on the next line, breaking it in the middle of
- > the string. Like this:
- >
- > fprintf(fp,"icc: %d retrieval method: %d sdll: %d sdml: %d n:
- > %d box: %d flag: %d",s.icc,s.retmeth,s.;
- >
- > But emacs C-mode couldn't handle the indentation properly, so I
- > presume that it wouldn't work. What is a good way to do this?
- One way is to put an \ at the end of the first line and begin the second at
- tab 0 like in:
- printf("Not a so long \
- string\n");
-
- If you work with an ANSI compiler you could just make two strings, which will
- be concatenated by the compiler like in:
- printf("This looks a little"
- " bit more readable\n");
-
-
- --
- Walter Misar
- misar@rbhp56.rbg.informatik.th-darmstadt.de
-