/*
 * tamanhos.cpp
 *
 *  Created on: 01/05/2009
 *      Author: blabos
 */
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    (void)argc;
    (void)argv;
    
    cout << endl << "Tamanho de referências:" << endl << endl;
    
    char	c;
	int		i;
	double	d;
	
	char&	rc = c;
	int&	ri = i;
	double&	rd = d;
	
	// O operador sizeof diz o tamanho do tipo do seu argumento.
	cout << "Size of char:    " << sizeof(c) << " bytes" << endl;
	cout << "Size of int:     " << sizeof(i) << " bytes" << endl;
	cout << "Size of double:  " << sizeof(d) << " bytes" << endl;
	
	cout << endl;
	
	cout << "Size of char&:   " << sizeof(rc) << " bytes" << endl;
	cout << "Size of int&:    " << sizeof(ri) << " bytes" << endl;
	cout << "Size of double&: " << sizeof(rd) << " bytes" << endl;
	
    return 0;
}
