#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
struct
{
short a1;
short a2;
short a3;
}A;
struct
{
long b1;
short b2;
}B;
void main()
{
char a[1024];
char *p=a;
char *b= (char *)malloc(100);
cout<<sizeof(a)<<endl;
cout<<sizeof(p)<<endl;
cout<<sizeof(A)<<endl;
cout<<sizeof(B)<<endl;
cout<<sizeof(b)<<endl;
cout<<sizeof(b+1)<<endl;
}
output:
1024
4
6
8
4
4