I have an unexpected result with the sizeof operator (C ++). In the main class, I have these lines
double * arguments_ = new double(); *arguments_ = 2.1; *(arguments_+1) = 3.45; cout << (sizeof arguments_) << ' ' << (sizeof arguments_[0]) << ' '<< (sizeof arguments_)/(sizeof arguments_[0]);
which give me the result 4 8 0
The double size is 8 bytes and (sizeof arguments_ [0]) = 8. However, why (sizeof arguments_) is also not expressed in bytes (2 * 8 = 16)? Is the operator sizeof applica
source share