Hallo, habe hier ein kleines Proggi zum erläutern der setiosflags & der resetiosflags Manipulatoren:
#include <iostream.h>
#include <iomanip.h>
int main()
{
const long showbase = 0x80L;
const long uppercase = 0x200L;
int i = 123;
float f = 123.123;
cout << i << "\t" << oct << i << "\t" << hex << i << "\tFloat-Kontrollwert: " << f << "\t/*** Ohne Flags ***/\n\n";
cout << setiosflags(showbase) << setiosflags(uppercase) << dec << i << "\t" << oct << i << "\t" << hex << i << "\tFloat-Kontrollwert: " << f << "\t/*** Mit Flags ***/\n\n";
cout << resetiosflags(showbase) << resetiosflags(uppercase) << dec << i << "\t" << oct << i << "\t" << hex << i << "\tFloat-Kontrollwert: " << f << "\t/*** Ohne Flags ***/\n\n";
system("PAUSE");
return 0;
}
Hier die Dev-C++ Fehlermeldung:
includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
Eigene Programme C++/BASEUP.cpp: In function `int main()':
Eigene Programme C++/BASEUP.cpp:30: invalid conversion from `long int' to `
std::_Ios_Fmtflags'
Eigene Programme C++/BASEUP.cpp:30: invalid conversion from `long int' to `
std::_Ios_Fmtflags'
Eigene Programme C++/BASEUP.cpp:36: invalid conversion from `long int' to `
std::_Ios_Fmtflags'
Eigene Programme C++/BASEUP.cpp:36: invalid conversion from `long int' to `
std::_Ios_Fmtflags'
make.exe: *** ["Eigene] Error 1
Ausführung beendet
Wie bekomme ich die "invalid conversion from `long int' to `std::_Ios_Fmtflags' " Fehlermeldung weg?
Danke
Bin für jede Hilfe dankbar..
t101 Gast |