Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (19 sloc) 459 Bytes
#include<iostream>
using namespace std;
struct stu
{
char name[22];
long int n;
int score[4];
} a ;
int main(){
cout << sizeof(a) <<endl;
cout << "size of long int: " << sizeof(long int) << endl;
cout << "size of int: " << sizeof(int) << endl;
cout << "size of char: " << sizeof(char) << endl;
cout << "size of name: " << sizeof(a.name) <<endl;
//40 4 4 1
int arr[32];
cout << "sizeof array arr:" << sizeof(arr)/sizeof(int) << endl;
return 0;
}
You can’t perform that action at this time.