02:13
@CPP, size of classes:

class a
{
private:
char c;
int i;
public:
a()
{
c='a';
i=10;
}
};

sizeof(a) is not 5, but it is 8.
funcitons in class are not counted in sizeof class, because they are shared among all objects of that class.
But, if there are virtual functions then sizeof pointer is added to sizeof class.
 

memory allocation of structure/class goes like this:


-->the data member which occupy the highest size in the given structure/class is examined.
-->memory is allocated as blocks of highest size, 
ex1:
struct a{
char c;
int i;
};
i=>4bytes, memory is allocated as blocks of 4 bytes,
i got 4 bytes, c will also get 4 bytes even it need just one byte. But, the compiler can only give the highest block size of memory.
struct a{
char c;
int i;
double d;
};
d=>8bytes
i=>4B,c=>1(4), it just need 1B, it got 4B.

memory allocated to a structure/class is always multiple of data width of microprocessor.
ex:for 32-bit microprocessor, it is multiple of 4-bytes

this is how it goes......try out your own problems on this.

for more details:
 http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member

packing and align: http://www.c-faq.com/struct/align.html









Placements

22:11
Practice SQL online:


http://sqlzoo.net/wiki/Main_Page
04:40
yii framework


how to install yii frame work on your system:
1. go to Yiiframework.com, navigate to download page. http://www.yiiframework.com/download/
2. download the source code.
3. unzip it and rename it as yii.
4. move that yii folder to your local host directory(in my case it is /var/www)
5. now go to terminal get into your local host root directory(www) and enter this command.

 root@satya-OptiPlex-9010:/var/www#  yii/framework/yiic webapp sample-app

6. It will ask for confirmation, say y for yes.

That's it....
your sample-app is ready.

now go to browser and type localhost/sample-app/
it's that simple...