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
Phili
unregistriert
Quellcode |
|
1 |
#pragma_once |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
1 class Typ 2 { 3 public: 4 void Methode() {} 5 void SchmeissNix() throw(); 6 }; 7 8 void Typ::SchmeissNix() 9 { 10 throw int(5); 11 } 12 13 int main() 14 { 15 Typ *Objekt = 0; 16 Objekt->Methode(); 17 return 0; 18 } Output FlexeLint for C/C++ (Unix) Vers. 8.00u, Copyright Gimpel Software 1985-2006 --- Module: simple.cpp (C++) _ void Methode() {} simple.cpp 4 Info 1762: Member function 'Typ::Methode(void)' could be made const _ { simple.cpp 9 Warning 1548: Exception specification for 'Typ::SchmeissNix(void)' conflicts with line 5 simple.cpp 5 Info 830: Location cited in prior message _ throw int(5); simple.cpp 10 Warning 1549: exception 'const int' not in throw-list of function 'Typ::SchmeissNix(void)' _ } simple.cpp 11 Info 1762: Member function 'Typ::SchmeissNix(void)' could be made const _ Objekt->Methode(); simple.cpp 16 Warning 413: Likely use of null pointer 'Objekt' in left argument to operator '->' [Reference: file simple.cpp: line 15] simple.cpp 15 Info 831: Reference cited in prior message _ } simple.cpp 18 Info 783: Line does not end with new-line --- Global Wrap-up Info 1714: Member function 'Typ::SchmeissNix(void)' (line 8, file simple.cpp) not referenced simple.cpp 8 Info 830: Location cited in prior message |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 |
int a = BerechneA(); CStern *pStern; if ( a < 0) pStern = pMond; if(a >= 0) pStern = pSonne; pStern->Zeichne(); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 |
int a = BerechneA(); CStern *pStern; if ( a < 0) pStern = pMond; a = BerechneANochmal(); if(a >= 0) pStern = pSonne; pStern->Zeichne(); |
Sicaine
unregistriert
Werbeanzeige