Programming: Logic and Design
Programming: Logic and Design
PROGRAMMING
LOGIC AND
DESIGN
JHON ERI C PE Ñ AFL ORI DA | CEI T 0 3 1 0 3 A
HISTORY OF C++
THE C++ PR OG RAMI N G LA NGUA GE I S O NE O F TH E
MOS T POPUL AR PROG RA M M I NG LA NGUA GES O U T
THERE, WHI C H H AS BE EN I N US E FO R O V ER FO U R
DECADES N OW. BUT DO Y O U K NO W A BO UT TH E
HI S TORY OF C + + AN D I TS TI M ELI NE?
DEV C++
C+ + WAS DE VE L OPE D BY BJ A RNE S TRO US TRUP W H I L E
WOR KI NG O N H I S PH . D. THES I S A T BELL LA BS I N 1979. H E
WAN TED TO C RE ATE A DY NA M I C LA NGUA GE T H AT
WOULD ALL OW PROG RA M M ERS TO BUI LD COM P L EX
S YS TEMS WI TH H I G H - LEV EL A BS TRA CTI O NS W H I L E STI L L
PR OVI DI NG L OW- L E VE L A CCES S TO THE HA RD W AR E.
SUPPOSE YOU' VE WRI TTEN A C++ PROGRAM. HOW DO YOU GET I T RUNNI NG? THE EXACT
STEPS DEPEND UPON YOUR COMPUTER ENVI RONMENT AND THE PARTI CULAR C++ COMPI LER
YOU USE, BUT THEY WI LL RESEMBLE THE FOLLOWI NG STEPS
COMPI LE EXECUTE
%%bash %%bash
C EQUI VALEN T
%%file hello01.c
Overwriting hello01.c
C++ IS A GENERAL-PURPOSE PROGRAMMING C++
LANGUAGE AND IS WIDELY USED NOWADAYS FOR
COMPETITIVE PROGRAMMING. IT HAS IMPERATIVE,
ENVIRONMENT
OBJECT-ORIENTED, AND GENERIC PROGRAMMING
FEATURES.
On c e y ou ha v e i n s t a lle d t he te xt e di to r a n d sa v e d y o u r p r o gr a m i n a f i l e w i t h t h e
‘ . cpp’ ext ensi o n , yo u wi ll n e e d a C+ + co mp i le r to co mp i l e t h i s f i l e . A c o mp i le r i s a
comput er pr og r a m t ha t co n v e rts hi gh- le v e l la n gua g e i nt o ma c h i ne - u nd e r st a nd a b le
l ow- l e v el l a n g ua g e . I n o t h e r wo rds, we ca n sa y tha t i t c o nv e r t s t h e so u r c e c o d e
wr i t t en i n a p r o g r a mmi n g la n gua ge i n to a n o the r co mp u t e r l a ngu a ge t h a t t h e
comput er und e r s t a n d s . F o r co mp i li n g a C+ + p ro gra m w e w i ll ne e d a C++ c o mp i le r
t ha t wi ll conv e r t t he so urce co de wri tte n i n C+ + i n t o ma c h i ne c o d e s.
SETTING UP C++ ENVIRONMENT
TEX T EDI TOR
From the main menu, choose File > New > Project to
open the Create a New Project dialog box.
At the top of the dialog, set Language to C++ , set
Platform to Windows , and set Project type to Console .
From the filtered list of project types, choose Console
App then choose Next . In the next page, enter a name
for the project, and specify the project location if
desired.
Choose the Create button to create the project.
ht t ps: / / www. g e e k s f o r g e e k s . or g / s e
t t i ng- c - de ve l o pme nt - e n v i r onme nt /
ht t ps: / / l e ar n. mi c r o s o f t . com/ e n-
us / c pp/ wi ndo w s / w a l k t h r oug h- cr e at i ng - a-
s t a ndar d- c pp- pr o g r a m- c p p ?v i e w = ms v c- 1 7 0