CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rafaluc



Joined: 12 Apr 2006
Posts: 6

View user's profile Send private message

RS232
PostPosted: Mon Jan 03, 2011 5:51 am     Reply with quote

Which the difference between putc and putchar.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Jan 03, 2011 8:05 am     Reply with quote

There is no functional difference, only aesthetic. I think if you look in the header files you will find putc is defined as putchar.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah



Joined: 11 Mar 2010
Posts: 19505

View user's profile Send private message

PostPosted: Mon Jan 03, 2011 9:29 am     Reply with quote

It is 'historical'.
putchar, is originally defined in K&R, as being equivalent to putc(c, stdout).
putc, in the original C implementation was equivalent to fputc, and required a stream name. On the standard C implementation, you always had three streams defined. stdin, stdout, and stderr (error output). If you just wanted to talk to stdout, and didn't want to type the name, you just use putchar.
In CCS, they are identical.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group