Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 |
MessageBox(NULL, L"sizeof<int>?", L"int: ", MB_YESNO); |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 |
MessageBox(NULL, L"snooc is doof", L"sizeof<???>", MB_OK); |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// Casts für Zahl<->String und co. template<typename A, typename T> inline const A lexical_cast (const T& source) { std::basic_stringstream<char> s; A destination; if (!(s << source) || !(s >> destination) || !(s >> std::ws).eof()) throw "bad lexical cast"; return (destination); } // Float in einen std::basic_string<char> casten std::basic_string<char> PI_as_string = lexical_cast<std::basic_string<char> >(3.14f); // und zurück casten float PI_as_float = lexical_cast<float>(PI_as_string.c_str()); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 |
cout << "Char Groesse: " << sizeof(char) << endl; cout << "Short Groesse: " << sizeof(short) << endl; cout << "Int Groesse: " << sizeof(int) << endl; cout << "Int8 Groesse: " << sizeof(_int8) << endl; cout << "Int16 Groesse: " << sizeof(_int16) << endl; cout << "Int32 Groesse: " << sizeof(_int32) << endl; cout << "Int64 Groesse: " << sizeof(_int64) << endl; cout << "wchar_t Groesse: " << sizeof(wchar_t) << endl; cout << "Long Groesse: " << sizeof(long) << endl; cout << "Float Groesse: " << sizeof(float) << endl; cout << "Double Groesse: " << sizeof(double) << endl; |
Anonymous
unregistriert
Zitat von »"Nox"«
Wozu in Gottes Namen brauchst du das überhaupt? Den Wert kannst dir auch vom Debugger ausgeben lassen.
Werbeanzeige