Die MemoryAlloc-Funktion kann man auch schöner machen:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
|
template <typename T>
bool MemoryAlloc(T*& pOut, const int iSize)
{
pOut = new T[iSize];
return true; //somit überflüssig
}
|
Ansonsten halte ich die Fragen für nicht so gelungen. Interressanter wäre es, wenn du Fragen zu C++-Wissen stellst (die for-schleifen sind ok, aber irgendwie langweilig), statt zu Kenntnissen zu einzelnen Funktionen aus irgendwelchen nicht-standard-libs.
Die Zuweisung in Frage2 ist im Übrigen nicht falsch:
ISO/IEC 14882
4.8 Floating point conversions [conv.double]
1 An rvalue of floating point type can be converted to an rvalue of another floating point type. If the source value can be
exactly represented in the destination type, the result of the conversion is that exact representation. If the source value
is between two adjacent destination values, the result of the conversion is an implementation-defined choice of either of
those values. Otherwise, the behavior is undefined.
2 The conversions allowed as floating point promotions are excluded from the set of floating point conversions.