PSP Hacks - Forums
Go Back   PSP Hacks - Forums > Tech Talk > PC Programming

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2008, 12:08 AM
pspjoke's Avatar
pspjoke pspjoke is offline
Programmer
PSP Hacker
 
Join Date: Mar 2008
Location: U.S.
Posts: 861
pspjoke User Has a Beginner Reputation
Default

well afaik they have the same features but i think printf is a little easier to use. i base this like this.

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");}
in that example they do exactly the same thing, but printf is easier imo.
__________________
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...

Reply With Quote
  #2  
Old 07-15-2008, 12:13 AM
RainMotorsports's Avatar
RainMotorsports RainMotorsports is offline
Programmer
PSP Guru
 
Join Date: May 2008
Location: 0x00Serbia
Posts: 1,795
RainMotorsports User Has a Beginner Reputation
Default

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.
Reply With Quote
  #3  
Old 07-15-2008, 12:17 AM
Joe88's Avatar
Joe88 Joe88 is offline
Moderator
PSP Titan
 
Join Date: Jun 2005
Location: Staten Island, New York City
Posts: 21,350
Joe88 User Has a Beginner Reputation
Default

really depends but cout is mainly c++ only

C C++
printf = cout
scanf = cin
__________________

[λ] The cake is a lie... [λ]
Reply With Quote
  #4  
Old 07-15-2008, 02:04 AM
Kenchin Kenchin is offline
PSP Newbie
 
Join Date: Jul 2006
Posts: 26
Kenchin User Has a Beginner Reputation
Default

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.
Reply With Quote
  #5  
Old 07-15-2008, 03:41 PM
LordCthulu LordCthulu is offline
Senior Member
PSP Veteran
 
Join Date: Mar 2005
Posts: 1,004
LordCthulu User Has a Beginner Reputation
Default

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
Reply With Quote
  #6  
Old 07-16-2008, 07:31 AM
ZiNgABuRgA's Avatar
ZiNgABuRgA ZiNgABuRgA is offline
Moderator
PSP Titan
 
Join Date: Sep 2006
Location: 4CHIN
Posts: 10,405
ZiNgABuRgA can only hope to improve
Default

printf - it's faster. Extra features in cout usually unnecessary.
Reply With Quote
Reply

 



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:05 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©