After being told using scanf and printf instead of cout and cin
because they are treated like a function instead like cout and cin being treated as a object thus equaling faster code generation so I am relearning as a i go Can you not use a string in printf or scanf instead use chars?
Sep 09, 2018 printf sends data (as text) to the output - scanf reads textual data from the input. There is also fprintf/fscanf that do the same thing to a FILE stream. Also sprintf/sscanf that do the same to a string as a buffer in memory. Loads of variations. You are using the wrong format specifier in the scanf and doing this will result in UB(Undefined Behaviour).The correct format specifier for a double is%lf while that of a float is%f. So Just change your scanf. C scanf The scanf function in C is used to read the data from stdin. Well.the question might have some edits The reason is 1. Scanf is the format specifier which is used only in C language 2. Taking C into consideration, we use cin as standard input instead on scanf. So the question should be “What does scanf (. 3 days ago We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand.
also If i have this code
How do i open the file?
![]() Salem5,138
> After being told using scanf and printf instead of cout and cin
Why? or better yet, Who said it?
> because they are treated like a function instead like cout and cin being treated as a object thus equaling faster code generation
Do you have references, or evidence of this? Printf Y Scanf En Dev C++![]() Printf Scanf In C++
Do you want to be a C programmer or a C++ programmer?
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |