Skip to main content

Data Types in C++

Basic Data types: The basic data types are integer-based and floating-point based. C++ language supports both signed and unsigned literals.


The memory size of basic data types may change according to 32 or 64 bit operating system. 

Let's see the basic data types. It size is given according to 32 bit OS.



Data TypesMemory SizeRange
char1 byte-128 to 127
signed char1 byte-128 to 127
unsigned char1 byte0 to 127
short2 byte-32,768 to 32,767
signed short2 byte-32,768 to 32,767
unsigned short2 byte0 to 32,767
int2 byte-32,768 to 32,767
signed int2 byte-32,768 to 32,767
unsigned int2 byte0 to 32,767
short int2 byte-32,768 to 32,767
signed short int2 byte-32,768 to 32,767
unsigned short int2 byte0 to 32,767
long int4 byte
signed long int4 byte
unsigned long int4 byte
float4 byte
double8 byte
long double10 byte

  1. Derived Data Types:
     The data-types that are derived from the primitive or built-in datatypes are referred to as Derived Data Types. These can be of four types namely:
    • Function
    • Array
    • Pointer
    • Reference

C++ Keywords(की वर्ड )

A keyword is a reserved word. You cannot use it as a variable name, constant name etc. A list of 32 Keywords in C++ Language which are also available in C language are given below.


autobreakcasecharconstcontinuedefaultdo
doubleelseenumexternfloatforgotoif
intlongregisterreturn
short
signedsizeofstatic
structswitchtypedefunionunsignedvoidvolatilewhile


C++ Operators(ऑपरेटर्स )

An operator is simply a symbol that is used to perform operations. There can be many types of operations like arithmetic, logical, bitwise etc.

There are following types of operators to perform different types of operations in C language.
  • Arithmetic Operators(अर्थमेटिक ऑपरेटर्स )
  • Relational Operators(रेलशनल ऑपरेटर्स)
  • Logical Operators(लॉजिकल ऑपरेटर्स )
  • Bitwise Operators(बिट् वाइज ऑपरेटर्स)
  • Assignment Operator(अस्सैंमेंट ऑपरेटर्स) 
  • Unary operator(यूनरी ऑपरेटर्स )
  • Ternary or Conditional Operator
  • Misc Operator


(ऑपरेटर्स in C++)
Dear Students :-ऊपर लिखे ऑपरेटर्स को बहुत अच्छे से read out करना है क्योकि ये ओपेरटस से ही हम लोग प्रोग्राम्स में Help लेंगे | 



Comments

Popular posts from this blog

Input Devices

Input Devices(इनपुट डिवाइस ) Input device enables the user to send data, information or control signals to computer. Central processing unit of computer receives the input and processes it to produce output. Some of the popular input devices are: Keyboard Mouse Scanner Joystick Light Pen Track ball Digitizer Microphone Magnetic Ink Character Recognition (MICR) Optical Character Reader (OCR) Keyboard (कीबोर्ड ) It is a basic input device that is used to enter data by pressing keys. It has different sets of keys for letters, numbers, characters and functions. QWERTY keyboard is the commonly used keyboard to enter data. Mouse (माउस) It is a hand held input device. It is used to move cursor or pointer across the screen. It generally has left and right button and a scroll wheel between them. Laptop computers come with a touch pad that works as a mouse. It lets you control the movement of cursor or pointer by moving your finger over the touchpad. Scanner (...

Types of computer

Types of Computer (कंप्यूटर के प्रकार ) We can categorize computer by two ways: data handling capabilities and size. On the basis of data handling capabilities , the computer is of  three  types: Analogue Computer (एनालॉग  कंप्यूटर ) Digital Computer (डिजिटल कंप्यूटर ) Hybrid Computer (हाइब्रिड कंप्यूटर ) 1) Analogue Computer(एनालॉग  कंप्यूटर ) Analog computers are designed to process analogue data. Analogue data is continuous data that changes continuously and cannot have discrete values such as speed, temperature, pressure and current. The analogue computers measure the continuous changes in physical quantity and generally render output as a reading on a dial or scale. Analogue computers directly accept the data from the measuring device without first converting it into numbers and codes. Speedometer and mercury thermometer are examples of analogue computers. 2) Digital Computer(डिजिटल कंप्यूटर) A digital computer is designed to perfor...

OUTPUT DEVICES

Output Devices(आउटपुट डिवाइस ) The output device displays the result of the processing of raw data that is entered in the computer through an input device. There are a number of output devices that display output in different ways such as text, images, hard copies, and audio or video. Some of the popular output devices are: Monitor CRT Monitor LCD Monitor LED Monitor Plasma Monitor Printer Impact Printers Character Printers Dot Matrix printers Daisy Wheel printers Line printers Drum printers Chain printers Non-impact printers Laser printers Inkjet printers Projector 1) Monitor(मॉनिटर) The monitor is the display unit or screen of the computer. It is the main output device that displays the processed data or information as text, images, audio or video. The types of monitors are given below. i ) CRT Monitor(सी आर  टी  मॉनिटर ) CRT monitors are based on the cathode ray tubes. They are like vacuum tubes which produce images in the ...