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 support@ccsinfo.com

Serial output in C++

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



Joined: 30 Jun 2005
Posts: 1

View user's profile Send private message

Serial output in C++
PostPosted: Thu Jun 30, 2005 10:02 am     Reply with quote

I am currently trying to test the interrupts in one of my the programs I wrote for a pic by coding a program for windows that will output to COM1 every second. However, I've searched all over the internet and cannot find anyway to do serial output in c++. I tried the #use preprocessor that I used in c, but it doesn't seem to be supported in c++. Can anyone help me get serial output in c++?
Ttelmah
Guest







PostPosted: Thu Jun 30, 2005 10:20 am     Reply with quote

You seem to be getting confused.
#use, is specific to the CCS C, and has nothing to do with either C, or C++. It is a way of defining the hardware setup for the I/O port involved. By default C, and C++, are normally running inside an operating system, so serial I/O, can just be done by the file I/O operations (which CCS does not have, since it is not run inside an OS). The default display, is normally preprogrammed to use the 'STDIO' port, allowing this to be used by default by the getc, putc, printf etc., functions.
Every operation supported in C, is available in C++.
For C++, using it's own I/O model, you normally need to include the stream handling header files, and you can then use the 'cin', 'getline', and the 'cout' operators, with the '<<', and '>>' directors. I/O is just another 'stream' in C++.

Best Wishes
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Fri Jul 01, 2005 2:17 am     Reply with quote

http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c2503/
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