Question about evaluating the arguments of printf (maybe OT?)

From: Edith Gross (egrossde_at_yahoo.de)
Date: 11/02/03


Date: Sun, 02 Nov 2003 09:34:01 +0100

Let us assume, f1(char *buf) and f1(char *buf) are two functions that
as a side effect calculate a string. The string will be placed in buf and
buf is returned by both f1 and f2.

Should this work:

char buf[100];
fprintf(fp,"%s%s",f1(buf),f2(buf));

Or should I take two different buffers, that is

char buf1[100],buf2[100];
fprintf(fp,"%s%s",f1(buf1),f2(buf2));

TIA,
EG

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---



Relevant Pages

  • Re: Help needed with macros: Brain turning to jelly
    ... '(('string buf) ) ... QUOTE their argument, usually. ... :pointer args ...
    (comp.lang.lisp)
  • Re: newbie question
    ... avoid memory allocations: the data can be swapped in-place. ... // modifies the contentes of 0-terminated 'buf' as described above ... string swapHalves ...
    (comp.lang.cpp)
  • Re: difference between casting and atol,atoi functions
    ... The first is ill-formed since buf may not be suitably ... character code 255 need not represent a digit ... or a text string ... Note that the size and representation of a signed long can ...
    (comp.lang.c)
  • Re: difference between casting and atol,atoi functions
    ... The first is ill-formed since buf may not be suitably ... character code 255 need not represent a digit ... or a text string ... Note that the size and representation of a signed long can ...
    (alt.comp.lang.learn.c-cpp)
  • Re: GetWindowText - Windows API
    ... GetWindowText has a third parameter, ie the length of the buffer where it ... string @lpClassName, string @WindowName ... local buf, nchars ...
    (microsoft.public.fox.programmer.exchange)