JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: c++ language in hindi

C++ : Character Type in hindi , what are Character Types in c++ language in hindi , symbol , programe

what are Character Types in c++ language in hindi , symbol , programe , C++ : Character Type in hindi :-
character data type का c++ का मुख्य data type है |हमने C language मे पढ़ा की char किसी signal character को store करता है |लेकिन C++ मे char data type मे दोनों character और digit को store कर सकता है |अतः char data type को integer का type भी कहते है |इस data type मे सभी सिम्बल्स – letters  , digits, punctuation और आदि को store करने के लिए enough memory space होता है |
Symbol
Computer मे 256 characters होते है |इसे ASCII character set कहते है |उदाहरण के लिए 65 का character ‘A’ होता है | अतः char data type 65 के लिए “A” को ही store करता है |उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using nameapace std;
char c;
cout<<“Enter Character”<<endl;
cin>>c;
cout<<“Welcome”<<c<<“in the world of C++.”<<endl;
getch();
}
इस उदाहरण मे , ‘c’ एक character type data है जिसमे यूजर द्वारा दिए जाने वाले character को store किया जाता है |
आउटपुट होगा :
Enter Character P
Welcome P in the world of C++.
यहा पर P का character code 80 है |आउटपुट मे “P” मे print होगा |लेकिन जब memory से डील करते है तब memory location मे 80 store होता है |Cin और Cout statement आटोमेटिक character data type को integer data मे convert कर सकते है |यहा cin से character data type को integer मे convert कर देता है | Cout से integer data type को character data type मे convert कर देते है |अगर P को single quota मे क्लोज करे तो इसके integer value को print करता है |
उदाहरन के लिए
#include<iostream.h>
#include<conio.h>
void main()
{
using nameapace std;
char c;
int i;
cout<<“Enter Character”<<endl;
cin>>c;
cout<<“Welcome”<<c<<“in the world of C++.”<<endl;
cout<<“ASCII Value of c”<<i<<endl;
i=c;
c=c+1;
cout<<“ASCII Value of c”<<i<<endl;
cout<<“ASCII Value of c”<<c<<endl;
getch();
}
इस उदाहरण मे यूजर द्वारा input की जाने value ‘P’ है इसे ‘c’ variable मे assign किया जाता है | अतः ‘c’ की ASCII value integer ‘i’ मे assign किया जाता है | cout statement -1  से character को print करता है | cout statement -2 से , ‘c’ की ASCII value को print करता है |
cout.put ()
ये function c++ के oops concept का पहला उदहारण है |इसे member function भी कहते है |member function मुख्य  class, ( किस तरह से data को manage करना है )को guide करता है |ostream एक एसी class है जिसमे put() function को use किया जाता है |इस function को ostream class के केवल एक function cout के साथ ही use किया जा सकता है | cout और put () function को एक साथ use के लिए period को use किया जाता है |इसे membership operator कहते है |syntax होता :
cout.put();
cout.puts का use << के स्थान पर किया जाता है | इसका मुख्य इस्तेमाल charecter के लिए किया जाता है |
Why cout.put()
जब C++ का 2.0 version release किया गया तब cout statement से character variable को character और character constant को number की तरह display करता है | जैसे “P” की जगह 80 को display करता है |ये प्रॉब्लम C++ 2.0 version से पहले आती थी |इस प्रॉब्लम को solve करने के लिए put() member function को बनाया गया | उदाहरण के लिए
#include<iostream.h>
#include<conio.h>
void main()
{
using nameapace std;
char c;
char ch;
cout<<“Enter Character”<<endl;
cin>>c;
cout<<“Welcome”<<c<<“in the world of C++.”<<endl;
cout<<“Enter Character Constant”<<endl;
cin>>ch;
cout.put(ch);
getch();
}
अगर cout<<‘ch’; को use किया जाता तब Character Constant के ASCII value print होती है लेकिन cout.put(ch); से Character Constant , एक character के तरह treat होती है | और character print होता है |
Character Constant
Character Constant एसे character होते है जिनकी value constant होती है | सभी single character जी की single quote मे क्लोज होते है एक Character Constant होते है |उदाहरण के लिए :
The ASCII of ‘A’ : 65
The ASCII of ‘a’  : 97
The ASCII of 5   : 53
The ASCII of ‘ ‘   : 32
The ASCII of ‘!’   : 33
इस उदाहरन से देखा जा सकता है की “a” की value 97 है | यहा पर 97 ‘a’ का code नहीं है बल्कि ‘a’ अभी भी एक character है |लेकिन ये integer value का use memory मे store होने के लिए किया जाता है |
Character और spacial character के अलावा सभी escape code के भी ASCII value होती है जो की निन्म table मे है :
Character name
ASCII Symbol
C++ code
ASCII Decimal Code
ASCII Hex code
newline
NL
\n
10
0xA
Horizontal
tab
HT
\t
09
0x9
Vertical
Tab
VT
\v
11
0xB
Backspace
BS
\b
8
0x8
Carriage
Return
CR
\r
13
0xC
Alert
BEL
\a
7
0x7
Backlash
\
\\
92
0x5C
Universal Character Name
प्रोग्रामर द्वारा उपर discuss किये गये सभी chrecter को use कर सकता है | जैसे declare character ,character constant , escape character और many more |लेकिन C++ मे इन सभी के अलावा एक और category होती है जिसे universal character कहते है | इसे ISO द्वारा define किया गया है |
इसकी starting \u और \U से होती है और ये  8 hexadecimal से मिल कर बनता है |उदाहरण के लिए
int k\u00E2pple;
cout<<“Universal Character is \u00E2pple”<<endl;
ISO मे सभी universal character के लिए एक code को define किया गया है |इस उदाहरण मे code ’00E2′ , france a  code है |
Signed Or Unsigned Character
char का default type unsigned होता है | integer की  तरह unsigned character  की range भी बहुत बड़ी होती है | जैसे
signed character की range -128 से 127 होती है |
unsigned character की range 0 से 255 होती है |
इस article मे character data type को discuss किया है |अब C++ : Boolean Type मे Boolean data type को discuss करेगे |
Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

8 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

3 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now