1. !"#$% #" '(( ')*+,)+*-*./" 0*"1*.2-*.3$
!"# %&'()& *+(,+&- .()#/0#(1
45/"#/- -/6"*2.7-!
!
!
!
2&34) )& #&5(6&" 0#78&.&9&- &:846(#4,+4 .7;54<&5(#&6(#4,+4 .7;54 =#&.4<& >& #&5(6& ? #7,:#,4- ,6#&)4@44)1(#'&@44-AAA 4)1(#'&@44-AAA B(':)4+&@4C& AAA D#E&)4>&@4C& )& &+64.)(,6467 ? #78(.)(,637+4#&97 0#4,:,6.(- 0#(7+64- 67,6(.4- 640 )& >&8&34/ =#(,6(#)(".#7'7),+& (#E&)4>&@4C&" 6&C'4)E4>'7)4- #&,0(#78- E#:04/
www.ramona-markoska.info
8.0"9/.#.3$ 5" 0*$%2$)") - /.:-/") /. *.;"). ! !
!
!
=#70(#&3&)4 #7,:#,4F
www.ramona-markoska.info ,( <4)+(.4 8( ,467 #7<7.&)6)4 ,6#&)4 www.cplusplus.com
Bjarne Stroustrup's homepage www.stroustrup.com/
!
!
C++ +&+( ,7 0#(E#&'4#& – !7467< !7467<- 545<4(67+& GHI J54#+& >&8&34 0( K(.78 .( 0#(E#&'4#&97 L" GHI- %&'()& *+(,+&
www.ramona-markoska.info
!" "#. 0"1<.#=$>
!
J&0(>)&.&97 ,( 0#78'76(6 4 0#&.4<&6& )& #&5(6&
!
=#7>7)64#&97 )& #7,:#,4 4 8(E(.(# >& +(#4,6797
!
=#7>7)64#&97 )& ,(8#;4)&6& +(C& M7 ,7 4>:3:.&/
!
N,6(#4C&6 )& 0#(E#&',+467 C&>4@4
!
K(.78 .( OPOQQ
!
K(.78 .( 0#&+643)& #&5(6&F !7'(),6#&@4C& )& +(#4,6797 )& #&5(6)& (+(<4)& Dev C++ 4.9.9.2 www.ramona-markoska.info
"#$%&$'$ () *+,-, %) '#./#)0$#)-, Einstein F !7< (8 '4,<4 0(,75)( >E(8)4 >& +(#7<&@4C& ,( 0#(E#&'4#&97 4 OQQ /
“Imagination is more important than knowledge “ “ Logic Log ic will get you from A to B. Imagination will take you everywhere “ " “Anyone “Anyone can know - the point is to understand “. “Education is what remains after one has forgotten what one haslearned in school. scho ol.””
!"#$% #" 0*"1*.2-*.3$ ,.," ,"/7$0) ? "% ' %" '++ 11 !
R6( S
!
J(T6( S
!
B&+( S
O( +(C& @7< S KK”B(E& '&0467 )7 ,7
,(E<&,:.&&6 ,( 67#7)(6" .7#:.&C67 ': )& 67#7)(6” – R.&C@,+& U#'4C&0(E(.(#+&
“27 '(;7 8& )&:3467 8&
.(>467 .7<(,4078 .( 8(04T:.&CM4 ,7 ,( 4),6#:+6(#(6” www.ramona-markoska.info
C++ v.s. C
www.ramona-markoska.info
1. @5)"*-5,- *.9#"= /. 0*"1*.25,-)$ =.9-7- - 5"6)#$*")
www.ramona-markoska.info
@5)"*-5,- *.9#"= /. 0*"1*.25,-)$ =.9-7- - 5"6)#$*")
www.ramona-markoska.info
A"0+<.*/"5) /. 0*"1*.25,-)$ =.9-7-
www.ramona-markoska.info
http://spectrum.ieee.org/computing/software/the-2015-top-ten-pr http://spectrum.ieee.org/computing/software/the-201 5-top-ten-programmingogramminglanguages
www.ramona-markoska.info
C++ *$5+*5 online
www.ramona-markoska.info
1.2. !-%"#- /. 5"6#)$* O(16.7#
O4,67',+4 0#(E#&'4
D07#&64.)4 ,4,67'4
B()6#(<)4 0#(E#&'4
B(#4,)43+4 0#(E#&'4
V,<:;)4 0#(E#&'4
U0<4+&64.7) ,(16.7#
24;4
*&T4),+4
www.ramona-markoska.info
=#(E#&',+4 C&>4@4
K4T4 0#(E#&',+4 C&>4@4
O4'5(<43+4
BCDC @5)"*-=.) /. 0*"1*.25,- =.9-, 'E'(( 1.4.1. Timeline C 2&,6&)(+F WX E(84)4 (8 '4)&6 .7+F Ken Thompson, Thompso n, “B” 4 Denis ,6&)8T>&@4C&- ANSI 1980. =#.7),6.7)& )&'7)& Ritchie, Ritc hie, “C”- ,6&)8T>&@4C&(8#;:.&97 )& UNIX o.s. (=(,6(7< 4 YUZ- & (8 [XXW 0(,6(4 4 Y!Z C&>4+\/ I&9& +(4 6#75&<( 8& E4 4,0(<)4F K4T 0#(E#&',+4 C&>4+ ,( 4'0<7'7)64#&)4 '(;)(,64 )& '&T4),+4 C&>4+/ !
!
! !
!
!4#7+67) 0#4,6&0 8( '7'(#4C&- 0(E(<7'( ')(;7,6.( )& (07#&6(#4 =(E(8)(,64 )& <7,)& #&>54#<4.(,6 )& .4T 0#(E#&',+4 C&>4+ *(M- ,6&54<)(,6- 1<7+,454<)(,6 4 5#>4)& )& 4>.#T:.&97 )& '&T4),+4 C&>4+
%7<&64.)( 78)(,6&.)& ,4)6&+,&- 4 (E#&)437) ,76 )& )Ắ)( )&8(E#&8<4. 4 ,( ')(T6.( #&>.(C)4 545<4(67+4 )& 1:)+@44- T6( (.(>'(;:.& 78)(,6&.)( 0#(E#&'4#&97+('0&C<4#&97 4 E(<7'& 1<7+,454()(,6/ www.ramona-markoska.info
1.4.2. Timelin Timeline e C++
• O( 0(C&.&6& )& (5C7+6)( (#47)4#&)467 +()@7064 .(
0#(E#&'4#&976(- ,7 C&.:.& 0(6#75& (8 )&8(E#&85& 4 4>'7)& )& OF • L]^X =(C&.& )& O ,( +<&,4F +<&,4F • O6#:+6:#467 (.(>'(;:.&&6 0(8&6(@467 8& 4'&&6 ,&'( .#78)(,64 • B<&,467 (.(>'(;:.&&6 4 8714)4#&97 )& (07#&@44 )&8 0(8&6(@467 •
L]^_- )&,6&)(+ )& OQQ F `+,67)>4C&6& >)&34 87+& ,6&):.& >5(# >& )&8(E#&85& )& O- ,( 6(& T6( ,7 8(8&87)4 8(8&87)4 .4#6:7<)4 1:)@44 (>.('(;7)( 7 0#7+<(0:.&97 )& (07#&6(#467 Bjarne Stroustrup/
O6&)8T>&@4C& ANSI 1995.
.
www.ramona-markoska.info
BCFC G<$2$/)- /. $%$/ 0*"1*.25,- =.9-, !
O4)6&+,& 4 ,7'&)64+& )& 0#(E#&',+4(6 C&>4+
!
O4)6&+,)4 7<7'7)64F ! ! ! ! ! ! ! !
J)&@4 N'49& %7>7#.4#)4 >5(#(.4 N87)6414+&6(#4 G40(.4 )& 0(8&6(@4" +<&,414+&@4C&/ 2Ắ" 78)(,6&.)4 4 ,<(;7)4B()6#(<)4 ,6#:+6:#4 U)&3797b www.ramona-markoska.info
1.HC A"5).0,. /. 0*"1*.2-*.3$I :$,"* 0" :$,"* !
!
*&<& 84,+:,4C& +(E& .#784 )7+(C 0#(5<7' (8 67c)4+&- '&67'&64+& 4<4 8#:E& (5<&,6 8& ,7 #7T&.& ,( 0#(E#&'4#&97/ =#78)(,64 4 )78(,6&6(@4 )& 0#(E#&'4#&976( ./,/ +<&,43)( #7T&.&97 )& 0#(5<7'467/ !
! !
=(+#&C '&67'&643+467 1(#':<&@44" >&'7)& 4 )& <(E4+&6& )& (8<:3:.&97 - +(E& ,7 #7T&.& )& <4@7 '7,6(/ D#E&)4>&@4C& )& .<7>"4><7> B(#4,6797 )& #&5(6)& #&>.(C)& (+(<4)& a IDE(Integrated Development Environment) b 4 0(>)&.&97 )& ,4)6&+,&/ www.ramona-markoska.info
C (( "*1./-9.7-=. d O6#:+6:#& d =#('7)<4.4 4 640(.4 d B(),6&)64 d D07#&6(#4 d I&>437) K<7>P N><7>
d B()6#(<)4 ,6#:+6:#4 d H:)+@44 d I&>43)4 &
D,)(.)4 7<7'7)64
d B<&,4 d I45<4(67+4 • ISO O6&)8T>&@4C&" 0(7)6& A • C 5&>4#&)4 ? +()6#(<7#4#(5(64+&- web
O07@414+4 & =(8(5#:.&9&
O6#:+6:#& )& 0#(E#&'&
O<(;7)4 640(.4 )& 0(8&6(@4
!! !& ,7 +('7)64#& 0(6#75& (8 )&.#&M&97 )& ,(8#;4)467 F J(T6( 4 ,( +(C& +#&C)& @7<
d 24>4*&6#4@4 d O6#:+6:#4V)44 d !&6(67+4 d =(+&;:.&34 d !4)&'43+& &<(+&@4C& )& '7'(#4C&
BCHCBC @/)$1*-*./. *.9#"=/. ","<-/.? IDE(Integrated Development Environment) ! !
!
!
!
!
!
12$3.#" (+(<4)& .( +(C& ,7 04T:.& 0#(E#',+4(6 +(8 + (8 4(5.#,% 6.2" )&04T&) ,0(#78 ,4)6&,+& 4 ,7'&)64+& )& 0#(E#&',+4(6 C&>4+ 7)8$%96$ :)($6" )&34) )& +(C 0#(@7,(#(6 E4 Y#&>54#&Z 4 #7T&.& 0#(5<7'467/ ;.0'):<,#" 0#7.78:.&3- +(C E( (5#&5(6:.& 4>.(#)4(6 +(8 .( (5<4+ #&>54#<4. >& 0#(@7,(#(6- /6/)/ (5C7+67) 4<4 4>.#T7) +(8/ =,>)/,#"87< +(C (.(>'(;:.& 8767+64#&97 )& E#7T+467 .( 4>.(#)4(6 +(8- ,( @7< 8& '(;7 8& ,7 +('0&C<4#& ?$%6,# – .( .( ,<:3&C )& 0(6#75& 0(.#>:.& ,( 545<4(67+4 4 1"@44/ "#,2'#.&,9.# www.ramona-markoska.info
www.ramona-markoska.info
J.9#"$/ 7-,<+5 - .<.),- #" '((
www.ramona-markoska.info
C++ - "5/"#!
O6#:+6:#& )& OQQ 0#(E#&'&
!
%&5(6)& Dev C++ (+(<4)&
!
B(),6&)64 4 0#('7)<4.4
!
D07#&6(#4
!
I&>43)4 )Ắ >& K<7>"N><7>
www.ramona-markoska.info
1.5.2. ')*+,)+*. /. '(( 0*"1*.2.
1- // !"#$%&'( )*+,*) -'#" .' /("0('#$("&, /("0('#$("&, -$ /"-&')1)' %' /"2$&"3 %' /"2$&"3 %' -$3"4 ($+ *,* /'3 -"+(5*%'&' /'3 -"+(5*%'&' -$ "0('%*21)' /"#$61 /* /"#$61 /* * */. 7(* 3"#/'4,*('8$ * *.)(91)'8$ )'3' %'/*9'%*&$ 3"#$%&'(* %$ -$ /"4')1)''& %' 3"%.",'. 3"%.",' . 2. #include- +*($3&*)' %' /($+/(":$-"( .' )3,121)'8$ %' ('.%* ;*;,*"&$3* %'($+;* 2** *#*8' -$ /*91)''& )" /("+",5$%*$. /("+",5$%*$ . <" -,12'4") ='4, ='4, - )" 3"4 -$ -"+(5'%* ;' .*2%* i/o .*2%* i/o +$3,'(':**. +$3,'(':**. >$-&" -$ -($?')' cstdlib -($?')' cstdlib – ;*;,*"&$3' %' -&'%+'(+%* %'($+;* 7"2$&"3 * 3('4 %' 6 * 10. 7"2$&"3 * 0,')%'&' /("0('#'
www.ramona-markoska.info
7,8 – %'($+;* .' /$2'&$8$. /$2'&$8$. 7"-&'(* 3"#/'4,$(*, 3"#/'4,$(*, &.$. @*)%* )$(.** %$ /"+((51)''& -$3"0'9 3*(*,*:'
1.5.F. ')*+,)+*. /. '(( 0*"1*.2.
%' namespace 3.!"(*-&$8$ 3.!"(*-&$8$ %' std- *#/,*:*(' 3"(*-&$8$ %' -&'%+'(+%* *#$%1)'8' %' %'($+;*&$. %'($+;*&$ . A" &"' -$ -/($21)' -*&1':*4' %' .';1%' * %$$+%".%'2%"-& +')" %$3"4' *&$(':*4' ('.,*2%* ;*;,*"&$3* )" -$;$ *#''& +)$ %'($+;* -" *-&" *#$ ' ('.,*2%* %'#$%*. %'#$%*. 7"2$&"3 %' 0,')%' 0,')%' main 5. 7"2$&"3 %' =1%3:*4' ( =1%3:*4' (-"+(5*%' -"+(5*%')) – %'/*9'%*&$ +$,")* /($+ main -$ %'/'&-&)*4' .' /($)$+1)'2"& ( /($)$+1)'2"& (3"#/'4,$("& 3"#/'4,$("&)) 3'3" +' 4' +' 4' /($)$+1)' /("0('#'&' 3"4' -,$+*, -,$+*, * 3"* ;*;,*"&$3* +' 0* 3"(*-&*. 3"(*-&*. 9. B.%'21)' 3('4 %' '3&*)%"-&*&$. '3&*)%"-&*&$. <" .')*-%"-& "+ ";,*3 %' ";,*3 %' main, main, %$3"* 3"#/'4,$(* (';"&'& ;$. return ;$. return 0;
www.ramona-markoska.info
1.5.F. ')*+,)+*. /. '(( 0*"1*.2.
!(+(<+: )7 ,7 +(#4,64 using namespace std; 6#75& )& 0(376(+(6 )& ,7+(C #78 +&87 ,7 +(#4,6&6 )Ắ 347 >)&3797 5& Y0(C&,):.&97Z 8& ,7 04T:.& std :: . 2&.78:.&976( )& 0#&.4<&6& 4 84#7+64.467 0#78 main 7 ,( @7< 8& ,7 4>57E)7 )4.)( 0(.7M7+#&6#)( .'76):.&97 4 0(.4+:.&97 .( +(8(6
www.ramona-markoska.info
!"#"$ %&'()*( ,-,.,*/( *& 011 23453&.& 6 247&8*9:&;, =" >,',3:(3&*( (.(;& ( '?434:(
!" <4.,*/&3( !
!
!
!
// komentar red
vo eden
/* komentar vo dadeni granici */ cout<<“zdravo !!”<
!"#$%&%'%
asm,auto,bool,break,case,catch, case, continue, default, delete,… goto,if,namespace,new goto,if,name space,new,, ..typedef,e ..ty pedef,enn um /// В484F
http://cplusplus.com/doc/tutorial/ variables/ www.ramona-markoska.info
!$K;- - 0*.,)-:/- 0*-2$*"
-
-
!7< ,( 0(C&,):.&97 >& (+(<4)&6& 4 0#. 87< (8 >&8&3467 ,( .7;54/ O0T64 4 0(376)4 ,(8#;4)4 >& +(4 ,7 (37+:.& )4.( )& 0#78)&79& (8 0#76c(8)( (5#&>(.&)47/ =(.6(#:.&97 4 8(0(<):.&97 )& <4)+(.4 http://cplusplus.com/doc/tutorial/variables/ http://mendo.mk/Lecture.do?id=6 http://mendo.mk/Lecture.do?id=7
www.ramona-markoska.info