Oct 2, 2013 at 7:46pm UTC
Hi there,
printf() is defined in <cstdio>.
http://www.cplusplus.com/reference/cstdio/
Hope that helps.
All the best,
NwN
Oct 2, 2013 at 7:55pm UTC
Use cout
since you included <iostream>
include <cstdio>
if you want to use printf()
Oct 2, 2013 at 8:03pm UTC
Don't mix C++ input output with C input output. You must choose between only using cout and cin or only using printf and scanf - you should not mix them.
Last edited on Oct 2, 2013 at 8:26pm UTC
Oct 2, 2013 at 8:03pm UTC
Ah, I feel like a dunce!
Thanks a lot for the help guys
Oct 2, 2013 at 8:03pm UTC
We posted at the same time - you may have missed my post. It's important that you read it unless you want your program to randomly crash ;)
Last edited on Oct 2, 2013 at 8:26pm UTC
Oct 2, 2013 at 8:09pm UTC
@L B - would you be so kind as to explain why? I'm just interested in the reason, no critique intended.
All the best,
NwN
Oct 2, 2013 at 8:16pm UTC
Last edited on Oct 2, 2013 at 9:18pm UTC
Oct 2, 2013 at 8:25pm UTC
I stand corrected - apparently I didn't learn the first time either.