1 / 6
Aug 2008

Can anyone tell me this ? r scanf and printf faster than cout and cin ?

  • created

    Aug '08
  • last reply

    Mar '11
  • 5

    replies

  • 545

    views

  • 6

    users

  • 2

    links

2 years later

Hello,

I don't know if this is true, but when I was reading FAQ on one of the problem providing sites, I found something, that poke my attention:

Check your input/output methods. In C++, using cin and cout is too slow. Use these, and you will guarantee not being able to solve any problem with a decent amount of input or output. Use printf and scanf instead.

Can someone please clarify this? Is really using scanf() in C++ programs faster than using cin >> something ? If yes, that is it a good practice to use it in C++ programs? I thought that it was C specific, though I am just learning C++...

Yes.

It depends on the program/project/user preferences.

I strongly suspect that jacobadam is a spam bot. I guess this because he didn't complain about the other 20 posts he had that I deleted. smile I'll eventually get around to deleting all of the ones that I can.

Because we disabled the links in the sig box, you can't see the spam links.