#include <iostream>
int main()
{
using namespace std;
int i, num = sizeof(things) / sizeof(int);
cout << num << endl;
cout << &hand << endl;
cout << &hand+1 << endl;
cout << &hand+2 << endl;
char words[] = {'t','o','m','e'};
cout << sizeof(char) << endl;
cout << &words << endl;
cout << (char*)words << endl;
cout << &words + 1 << endl;
cout << &words + 2 << endl;
return 0;
}
int main()
{
using namespace std;
int hand[4] = {1,2,3,4};
int things[] = {1,5,3,8};int i, num = sizeof(things) / sizeof(int);
cout << num << endl;
cout << &hand << endl;
cout << &hand+1 << endl;
cout << &hand+2 << endl;
char words[] = {'t','o','m','e'};
cout << sizeof(char) << endl;
cout << &words << endl;
cout << (char*)words << endl;
cout << &words + 1 << endl;
cout << &words + 2 << endl;
return 0;
}
Note: the address is a separate type in C++, it's according to the type.
the char is the 4 bits space for computer world except the Bool type.