Mailinglist Archive: opensuse-programming-de (184 mails)
| < Previous | Next > |
Eigene Ausgabe in C++
- From: Bastian Schern <bschern01@xxxxxx>
- Date: Mon, 06 Oct 2003 23:39:45 +0200
- Message-id: <3F81E121.4040205@xxxxxx>
Hallo,
ich habe eine Klassenmethode, die je nach gesetzten Falgs die Ausgabe
auf den Bildschirm und/oder in ein File macht:
int DebugLog::out( string text )
{
// output to console
if( log_to_console == true ) {
cout << text;
}
// output to log file
if( log_to_file == true ) {
file << text;
}
return 0;
}
Wie bekomme ich es hin, dass es nicht nur für "string" funktioniert,
sondern für alle Typen die "cout" unterstützt?
Viele Grüße
Bastian
ich habe eine Klassenmethode, die je nach gesetzten Falgs die Ausgabe
auf den Bildschirm und/oder in ein File macht:
int DebugLog::out( string text )
{
// output to console
if( log_to_console == true ) {
cout << text;
}
// output to log file
if( log_to_file == true ) {
file << text;
}
return 0;
}
Wie bekomme ich es hin, dass es nicht nur für "string" funktioniert,
sondern für alle Typen die "cout" unterstützt?
Viele Grüße
Bastian
| < Previous | Next > |