fprintf or vfprintf

C

chellappa

hi
i am trying to create a buffer befor writting to file...but i dont
which one best and fast fprintf or vfprintf
thanks
by
CNS
 
V

Villy Kruse

hi
i am trying to create a buffer befor writting to file...but i dont
which one best and fast fprintf or vfprintf
thanks


For the stated purpose use sprintf(); or snprintf() if your system supports
it.

Villy
 
M

Malcolm

chellappa said:
i am trying to create a buffer befor writting to file...but i dont
which one best and fast fprintf or vfprintf
There's not much point messing about with IO buffering unless you really
know what you are doing.

fprintf() probably calls vsprintf() internally, but the difference is almost
certainly negligible, so simply call whichever is more convenient for the
program's high-level logic.

The best thing to do is almost always to accept the platform defaults for
standard IO, however you can use setvbuf() if you need that extra bit of
control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top