C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ein Byte ausgeben

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German)
View previous topic :: View next topic  
Author Message
Zeljko Peric
Guest





PostPosted: Wed Dec 03, 2003 8:49 pm    Post subject: ein Byte ausgeben Reply with quote



Hallo NG,
ich habe Aufgabe ein Steurungsprogramm für einen Roboter zu schreiben,
die muss über LPT erfolgen und die alle Kommandos sind in einem Byte
definiert. Wie schicke ich ein Byte an LPT, meine Kenntnise:
FILE* fp;
fp=fopen("prn","w");
char b;
fprintf(fp,"%c",b);
wie lässt sich sowas mit c++ stream bewerkstelligen?
Vielen Dank,
Zeljko Peric

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Markus Schaaf
Guest





PostPosted: Wed Dec 03, 2003 10:28 pm    Post subject: Re: ein Byte ausgeben Reply with quote



"Zeljko Peric" <deckic (AT) web (DOT) de> schrieb:

Quote:
FILE* fp;
fp=fopen("prn","w");
char b;
fprintf(fp,"%c",b);
wie lässt sich sowas mit c++ stream bewerkstelligen?

#include <fstream>
#include <ostream>

int main()
{
std::ofstream fp( "prn" );
char b;
fp << b;
}

Macht ungefähr das, was Dein obiges Programm tut. Sei aber gewarnt:
Es wird wahrscheinlich nicht funktionieren.

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
J. Meier
Guest





PostPosted: Wed Dec 03, 2003 11:20 pm    Post subject: Re: ein Byte ausgeben Reply with quote



Hi Zeljko Peric,

evt hilft Dir das ja etwas weiter.
http://martin.lohrke.bei.t-online.de/software.htm

Jan

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Albrecht Fritzsche
Guest





PostPosted: Fri Dec 05, 2003 11:08 am    Post subject: Re: ein Byte ausgeben Reply with quote

Markus Schaaf wrote:

Quote:
"Zeljko Peric" <deckic (AT) web (DOT) de> schrieb:


FILE* fp;
fp=fopen("prn","w");
char b;
fprintf(fp,"%c",b);
wie lässt sich sowas mit c++ stream bewerkstelligen?


#include #include
int main()
{
std::ofstream fp( "prn" );
char b;
fp << b;
}

Macht ungefähr das, was Dein obiges Programm tut. Sei aber gewarnt:
Es wird wahrscheinlich nicht funktionieren.

Ich wollt's ja erst nicht glauben - tja, funktioniert nicht. Also

bezeichnet "prn" wohl den Printer. Aber auf welcher Ebene wird dies
entschieden bzw wo kann ich dies bemerken? Wenn ich mich nicht taeusche,
ist

std::ofstream fp("prn");
assert(fp);

ok.
Ali

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Zeljko Peric
Guest





PostPosted: Wed Dec 10, 2003 9:02 pm    Post subject: Re: ein Byte ausgeben Reply with quote

J. Meier schrieb:
Quote:
Hi Zeljko Peric,

evt hilft Dir das ja etwas weiter.
http://martin.lohrke.bei.t-online.de/software.htm

Jan

Hallo und Danke an alle,

ich habe mir schon gedacht das es nicht einfach ist. Danke für die Hilfe,
Zeljko Peric

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German) All times are GMT
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, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.