0% found this document useful (0 votes)
24 views23 pages

C PP Language

C++ is an object-oriented, general purpose programming language. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in New York. C++ is a middle-level language that combines high-level and low-level language features. It allows programmers to control memory and programming abstractions. C++ is widely used for developing applications like operating systems, games, and business software.

Uploaded by

Honey Gain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views23 pages

C PP Language

C++ is an object-oriented, general purpose programming language. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in New York. C++ is a middle-level language that combines high-level and low-level language features. It allows programmers to control memory and programming abstractions. C++ is widely used for developing applications like operating systems, games, and business software.

Uploaded by

Honey Gain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

सी++

प◌्
रो ा मग भाषा

सी++ (C++ ; उ चारण: सी लस- लस) एक थै


तक
टाइप, वतं- प , ब - तमान सं
क लत, सामा य
। यह एक म य तरीय भाषा
योजन ो ा मग भाषा है
, य क यह दोन उ च तर
के प म जानी जाती है
और न न तर क भाषा सु
वधा का एक सं
योजन है

यह जान ता तप ारा वक सत सी भाषा क वृ के
प म बे
ल ले टरीज म 1979 म शु कया गया था।
बोरे
ल नाम सी वथ लासे
इस भाषा का मू स था, जसे
१९८३ म बदल कर सी++ कर दया गया। यह एक
खी (ऑ जेट ओ रएं
आ जेट उ मु ड) भाषा है
टे ।
सी++

पावाली ब - तमान, या मक,


काया मक, व तु ख,
उ मु
सामा य

तु
त वष 1983

पकार जान ता तप

वकासक जान ता तप
बे
ल योगशाला

मु
ख काया वयन सी++ ब डर, लग, कॉमु
C/C++, जीसीसी, इं
टे

C++ क पाइलर,
माइ ोसॉ ट वजअल C++,
सन टू
डयो
उपभाषाएँ ए बे
डे
ड सी++, मै
नेड सी
++, सी++/सीएलआई, सी
++/सीए स

भा वत कया आ, पाइक ,
पल, एलपीसी, लु
एडा 95 , जावा, पीएचपी,
डी, सी99, सी#,</ref>
फ़ै
लकन, सीड7

चालन त म ट ले
टफाम

सी++ केडजाइन का दशन


"द डजाईन एं
जान ता तप ने ड एवो यु
शन ऑफ़ सी
++" (1994) म सी++ के
बारे छ बात कह , वे
म कु इस
कार ह :
सी++ थै कत ( टै
तक टं टकली टाइ ड), सामा य-
उपयोग वाली (जनरल परपज) एवं
सी भाषा के
समान ही द एवं
पोटबल ो ा मग भाषा है

सी++ कई तरह के ो ा मग शै
लय का समथन
करने
केहसाब से
रची गयी है
। इसम ोसीजरल
-के त ो ा मग (ऑ जेट
ो ा मग, व तु
ओ रएंड ो ा मग), मॉ
टे लर ो ा मग, अथवा

जे
ने
रक ो ा मग शै
ली म सेकसी भी शै
ली को
अपनाकर ो ाम कया जा सकता है

इस बात का यान रखा गया हैक सी++ का सी के
साथ अ धक से
अ धक साम ज य बना रहे
। इस
कार सी म लखेो ाम अ धकाशतः बना कसी
प रवतन के
सी++ म चल सकते 'सी' के
ह। इससे
जानकार को सी++ म वे
श करने
म कोई असु
वधा
नह होती है

सी++ उन फ चर के
कारण कोई अ त र भार नह
डालती जो ो ाम म अ यु ह।

उपरो बात के
अतर सी++ क मु
ख वशे
षताएँ
न न ल खत ह-

ऑ जेट-ओ रए टे
ड ो ा मग
इनहे
रटस
लासे

पो लमो फ म
डाटा ए का सु
ले
शन
पोट ब लट
सं तता (Brevity) - सी++ म लखा कोड
अ य भाषा क तु
लना म ब त छोटा होता है

मॉ लर ो ा मग- सी++ केकसी अ लके
ु शन
के
अ दर अने -छोटेो ाम हो सकते
क छोटे ह
जनके
सोस कोड को अलग से
क पाइल करके
पर पर लक कर दया जाता है
। इससे
समय क
बचत होती है
। इसके
अलावा, मू
लतः कसी सरी
भाषा म लखेो ाम को
क पाइल करके
सी++ म स म लत कया जा
सकता है

सी-भाषा के
साथ क पे
ट ब लट
ते
जगत
चना पा सग (Message Passing)
सू
ग (Dynamic Binding)
ग तक बाइ डं

सी++ ो ाम का एक उदाहरण

#include <iostream>

using namespace std;


int main()
{
cout << "जय ह द -- Hallo Bharat"<<
endl;
cin.get();
}

ट-आउटपु
सरल इनपु ट
आउटपु

1 char *name="Tej Pratap";


2 char *country="India";
3
4 cout << "Hello, I am " << Tej Pratap
<< ". I am from "<< india << endl;

इनपु

# include Please enter


<iostream> an integer
using value: 5
namespace std; The value you
entered is 5
int main () and its square
{ is 25.
int i;
cout << "Please
enter an integer
value: ";
cin >> i;
cout << "The
value you
entered is " << i;
cout << " " << i*i
<< ".\n";
return 0;
}

नय ण
if else if
string selection; You have
selection = "ta"; selected the
Tamil
if Wikipedia
(selection=="hi")
cout<< "You
have selected
the Tamil
Wikipedia";
else if
(selection=="ta")
cout<< "You
have selected
the Tamil
Wikibooks";
else
cout<< "You
have selected
the Tamil
Wikisource";

switch

int selection; You have


selection = 2; selected
switch Tamil
(selection){ Wikibooks
case 1:
cout<< "You
have selected
Tamil
Wikipedia";
break;
case 2:
cout<< "You
have selected
Tamil
Wikibooks";
break;
default:
cout<< "You
have selected
Tamil
Wikisource";
break;
}
च (लू
प)
while

int i=1; The number is


while(i<=5) 1
{ The number is
cout << "The 2
number is "<< i The number is
<<"\n" ; 3
i++; The number is
} 4
The number is
5
do while

int i=1; The number is


do { 1
cout << "The The number is
number is " << i 2
<< "\n"; The number is
i++; 3
} while (i <= 5); The number is
4
The number is
5

for
int i=1; Iteration:1
Hello World!
for (i=1; i<=5; Iteration:2
i++) Hello World!
{ Iteration:3
cout << Hello World!
"Iteration:"<<i<<" Iteration:4
Hello World!\n"; Hello World!
} Iteration:5
Hello World!

फलन
pass by value
int main (){ The Sum is 6
int add (int a, int
b);
int ans;
ans = add(4, 2);
cout << "Ths
sum is " << ans
<< "\n";
return 0;
}

int add (int a, int


b){
int ans;
ans = a + b;
return ans;
}

pass by references

int main (){ a=11, b=13;


void passbyref
(int& a, int& b);
int a=1, b=3;
passbyref (a, b);
cout << "a=" <<
a << ", b=" << b
<< "\n";
return 0;
}
void passbyref
(int& a, int& b){
a = a + 10;
b= b + 10;
}

ऑबजेट ओ रए टे
ड ो ा मग

class Calculator The sum is: 8


{
int x, y;
public:
void
set_values
(int,int);
int add () {
int ans;
ans = x +
y;
return
ans;
}
};

void
Calculator::set_v
alues (int a, int
b) {
x = a;
y = b;
}

int main () {
Calculator c1;
c1.set_values
(5, 3);
cout << "The
sum is: " <<
c1.add() << endl;
return 0;
}

क पाइलर
जीसीसी
Cygwin
DJGPP (GCC का DOS-port)
MinGW (GCC का Windows-port)
Microsoft Visual C++ (Windows)
Intel C++-Compiler (Linux, Windows)
Digital Mars (DOS, Windows)
Borland C++-Compiler (Windows)

आई डी ई (IDE's)

माइ ोसॉ ट वजु डयो (Windows)


अल टु
Dev-C++ -- मु ोत
QtCreator,
KDevelop,
Code::Blocks [1] ,
Eclipse
NetBeans (Windows, Linux, Mac OS X en
Solaris)
CodeLite (Windows, Linux en Mac OS X)
CLion (Windows, Linux en Mac OS X)

इ ह भी दे

सी ो ा मग भाषा
ो ा मग भाषा क तु
लना
जावा ो ा मग भाषा
सी++ क पाइलर क सू
ची

बाहरी क ड़याँ
A paper by Stroustrup showing the
timeline of C++ evolution (1979-1991)
Standards Committee Page:
JTC1/SC22/WG21 - C++
C++ FAQ Lite by Marshall Cline

स दभ

"https://hi.wikipedia.org/w/index.php?title=सी
%2B%2B&oldid=3861595" सेलया गया

Last edited 6 months ago by अनु


नाद …

साम ी CC BY-SA 3.0 के


अधीन है
जब तक अलग से
उ ले

ना कया गया हो।

You might also like