![]() |
|
#1
|
||||
|
||||
|
Code:
#include <iostream.h>
int main(){
int x=13;
int y=14;
printf("x == %i \ny == %i\n",x,y);
cout<<"x == "<<x<<"\ny == "<<y<<"\n";
system("pause");}
__________________
PHAT(TA-086) & GOW Slim(TA-088v2) - firmware: 5.00M33-3 - addons: 1.50 addon(phat). Me: newbie programmer... Levone == pspjoke;
My Projects ignorance is forgivable.. stupidity is a sin i can never forgive. catch my latest projects at... |
|
#2
|
||||
|
||||
|
printf is from old C syntax C++ carried it over and has both. Printf seems closer in command to how we do console apps in pascal with println. Somewhat error prone according to an article on google.
__________________
SOFTWARE: Rain's Simple MMS Maker | Rain's UltraLite MMS Makers TUTORIALS: PlayStation One on PSP Guide | UMD/ISO/CSO Guide | Recovery Flasher | FATMSMOD 3.71 on 4.01 | 4.05 Visualizer on 4.01
|
|
#3
|
||||
|
||||
|
really depends but cout is mainly c++ only
C C++ printf = cout scanf = cin |
|
#4
|
|||
|
|||
|
It really depends on the use >.<; *lol I kinda expected to read this in the first posts* printf is expensive as far as overhead is concerned when your trying to optimize absolutely and if your processor is weak.... (alright so most things your going to be programming this really doesnt matter but it's just something to keep in mind), and cout seems to be more direct without going through all the formatting overhead so it's just a trade off convenience for you and processing speed for the user =P.
|
|
#5
|
|||
|
|||
|
I use cout most of the time. Every once in a while I'll use printf().
__________________
Member number: 3 Meat lover? Watch: http://www.chooseveg.com/animal-cruelty.asp |
|
#6
|
||||
|
||||
|
printf - it's faster. Extra features in cout usually unnecessary.
|
![]() |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|