// memAllocation.cpp 
//my attemmpt at finding out exactly 
//how data types are allocated memory
#include <iostream>
using namespace std;

int main (void)
{
long int pShort, pInt, pLong, pFloat, pDouble, pLongDouble, pChar, pBoolean;

 short int shortIntA, shortIntB; short int *pShortIntA, *pShortIntB;
 pShortIntA = &shortIntA; pShortIntB = &shortIntB;
 cout<<"Adjacent short integers have addresses "<<pShortIntA <<" and "<<pShortIntB <<endl;

 int intA, intB;	  int *pIntA, *pIntB;
 pIntA = &intA; pIntB = &intB;
 cout<<"Adjacent integers have addresses "<<pIntA <<" and " <<pIntB <<endl;

 long int longIntA, longIntB, *pLongIntA, *pLongIntB;
 pLongIntA = &longIntA; pLongIntB = &longIntB;
 cout <<"Adjacent long integers have addresses "<<pLongIntA <<" and " <<pLongIntB <<endl;


 float floatA, floatB, *pFloatA, *pFloatB;
 pFloatA = &floatA; pFloatB = &floatB;
 cout<<"Adjacent floats have addresses "<<pFloatA <<" and " <<pFloatB <<endl;

 double doubleA, doubleB, *pDoubleA, *pDoubleB;
 pDoubleA = &doubleA; pDoubleB = &doubleB;
 cout<<"Adjacent doubles have addresses " <<pDoubleA <<" and " <<pDoubleB <<endl;

 long double longDoubleA, longDoubleB, *pLongDoubleA, *pLongDoubleB;
 pLongDoubleA = &longDoubleA; pLongDoubleB = &longDoubleB;
 cout<<"Adjacent long doubles have addresses "<<pLongDoubleA<<" and "<<pLongDoubleB <<endl;

 char charA, charB; char *pCharA, *pCharB;
 pCharA = &charA; pCharB = &charB;
 cout<<"Adjacent characters have addresses "<<pCharA <<" and " <<pCharB <<endl;

 bool booleanA, booleanB, *pBoolA, *pBoolB;
 pBoolA = &booleanA; pBoolB = &booleanB;
 cout<<"Adjacent Booleans have addresses "<<pBoolA <<" and " <<pBoolB <<endl;

return 0;
}

