Was ist der Unterschied zwischen: new int*[]
und new (int*)[]
:Unterschied zwischen neuen (float *) [] und neue Schwimmer * []
int** pA = new int*[2] // returns a pointer to an array of pointers to int.
new (int*)[2] // what should this return ? Shouldn't it be same as the above.
Ebenso
float* pB1 = new float[3]; // compiles successfully.
float* pB2 = new (float)[3] //Gives an error. Shouln't it return an array of floats ?
Aber der Compiler sagt:
A value of type 'float' cannot be used to initialize a value of type float* .
Was fehlt mir hier? Ich verwende VS2015 Community IDE.
wies Sie eine neue Platzierung anfordern; der Aufruf wird als Zeiger verstanden, der an new übergeben wird; siehe https://stackoverflow.com/questions/222557/what-uses-are-there-for-placement-new – OznOg
http://en.cppreference.com/w/cpp/language/new – Barry
@OznOg, sollten Sie Erweitern Sie den Kommentar zu einer vollständigen Antwort. –