Search This Blog

Read Your Language

Size of data types in C++

           What is Size of data types in C++?

इसमें हम सीखने जा रहे है की आखिर C++ में  सब भी डाटा का  क्या size  होता है  ? 
यह हमारे लिए महत्वपूर्ण है क्यूँकि हम इससे  मेमोरी में ज्यादा स्टोर  करने वाले डाटा को कम स्टोर में परिवर्तित कर सकता है | खासतौर हम यह पता भी होना चाहिए | 

Program in C++ 


#include<iostream>
using namespace std;
int main()

cout<<"size of character :"<<sizeof (char)<<endl;
cout<<"size of unsigned char :"<<sizeof (unsigned char)<<endl;
cout<<"size of signed char :"<<sizeof (signed char)<<endl;
cout<<"size of inte :"<<sizeof (int)<<endl;
cout<<"size of unsigned int :"<<sizeof (unsigned int)<<endl;
cout<<"size of signed int :"<<sizeof (signed int)<<endl;
cout<<"size of short int :"<<sizeof (short int)<<endl;
cout<<"size of unsigned short int :"<<sizeof (unsigned short int )<<endl;
cout<<"size of long int :"<<sizeof (long int)<<endl;
cout<<"size of signed long int :"<<sizeof (signed long int)<<endl;
cout<<"size of unsigned long int :"<<sizeof (unsigned short int )<<endl;
cout<<"size of float :"<<sizeof (float )<<endl;
cout<<"size of double :"<<sizeof (double)<<endl;
cout<<"size of long double :"<<sizeof (long double)<<endl;
cout<<"size of wchar_t :"<<sizeof (wchar_t)<<endl;
}


According to the Dev C++ in 32 bit of Window , Size of the data types in the C++ is Output is :

OUTPUT:
 size of character : 1
size of unsigned char : 1
size of signed char :  1
size of integer : 4
size of unsigned int : 4
size of signed int : 4
size of short int : 2
size of unsigned short int : 2
size of long int : 4
size of signed long int : 2
size of unsigned long int : 8
size of float : 4
size of double  : 8
size of long double  : 12 
size of wchar_t : 2



No comments:

Contact Form

Name

Email *

Message *

Followers