3 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for tapananand

Consider the following code: #include<stdio.h> #define msizeof(type) ((char*)(&type) - (char*)(&type - 1)) int main() { int x; printf("%u %u\n", msizeof(x), sizeof(x)); return 0; } The Above code when compiled with g++ compiles just fine and works well without any wanrings, while in gcc it gives the following warning: `integer overflow …

Member Avatar for vijayan121
0
829
Member Avatar for DmytriE

Hello everybody, I have never done anything with dynamic memory allocation and was trying to allocate enough memory to hold four elements of an array. Each of these elements will hold another array that will hold the actual data. My questions is how can I check the size of a …

Member Avatar for DmytriE
0
114
Member Avatar for Jsplinter

All things equal, does an object of a class which has methods take up more memory resources than an instance of a class without methods. What if it is a vector of such objects? For example: [CODE] class A{ public: void DoSomething(); void DoSomethingelse(); private: int x, y; }; class …

Member Avatar for mike_2000_17
0
135

The End.