Memory allocation for objects, C/C++ Programming

when a class is defined the compiler will not allocate memory.


class item

{ int number; float cost; public:

void getdata(int a, float b);

void putdata(void);



Memory is not allocated for number and cost data members.






Write discussion on Memory allocation for objects
Your posts are moderated
Related Questions
#include stdio.h> #include conio.h> #include string.h>   void del(char[],char *); main() {           char str[30],ch,*pp;           clrscr();           p

In POS system, cashier computer connect to printer using serial rs232 usb or cable. We need to capture data from that connection, and parsing the data to get total amount for every


Program is to replace every occurrence of in a string: Program is to replace every occurrence of c1 in string with c2 and have function return the no. of replacement int re

railway reservation programming

Encapsulation and Data Hiding The property of being a self-contained unit is known as encapsulation. The idea that the encapsulated unit can be used without knowing how it work


Class Templates In addition to function  templates, C++  also supports the  method of class templates. By definition, a class template is a class definition that explains a fam

Write a program to input two integers. If they are equal display "The numbers are equal". Otherwise display a message if the first is a multiple of the second or if it is not a mul