Original Post
In the following block of code can anyone explain why the sizeof() function returns a 4. And what are the differences in array declarations between b and c.
A little demonstration:
#include <iostream>
using namespace std;
int main(void) {
int a;
int b[10];
int *c = new int[10];
cout << sizeof(int) << " = " << sizeof(a) << endl; // 4
cout << sizeof(int[10]) << " = " << sizeof(b) << endl; // 40
cout << sizeof(int*) << " = " << sizeof(c) << endl; // 4
delete [] c;