<pre name="code" class="cpp">#include  <iostream>
using std::cout;	using std::cin; using std::endl;

#include <string>
using std::string;	
#include <cstring>
#include <vector>
using std::vector;

#include <iterator>
using std::begin; using std::end;

#include <cstddef>
using std::size_t; 


int main()
{
	int ia;
	cout << "the bytes of int is " << sizeof ia << endl;
	short sa;
	cout << "the bytes of short is " << sizeof sa << endl;
	long  la;
	cout << "the bytes of long is " << sizeof la << endl;
	long long lla;
	cout << "the bytes of long long is " << sizeof lla << endl;
	float fa;
	cout << "the bytes of float is " << sizeof fa << endl;
	double da;
	cout << "the bytes of double is " << sizeof da << endl;
	long double lda;
	cout << "the bytes of long double is " << sizeof lda << endl;
	return 0;
	
}



输出

 

the bytes of int is 4
the bytes of short is 2
the bytes of long is 4
the bytes of long long is 8
the bytes of float is 4
the bytes of double is 8
the bytes of long double is 12


 

相关文章:

  • 2021-11-13
  • 2021-07-19
  • 2022-12-23
  • 2021-11-21
  • 2021-09-23
猜你喜欢
  • 2021-07-04
  • 2022-12-23
  • 2021-12-13
  • 2021-11-17
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案