Unit - 1 (C++)

You might also like

Download as pdf
Download as pdf
You are on page 1of 2
ty Unit-1 History of Cz - Language programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A. Dennis Ritchie is known as the founder of the ¢ language. It was developed to overcome the problems of previous languages such as B, BCPL, etc. Initially, C language was developed to be used in UNIX operating system. It inherits many features of previous languages such as B and BCPL. History of C++: - C+ programming language was developed in 1980 by Bjare Stroustrup at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A.\Bjante Stroustrup is known as the founder of C+ language. It was develop for adding a feature of OOP (Object Oriented Prograniming) in C without significantly changing the C component. C+ programming is "relative" (called a superset) of C, it fieans any Valid C program is also a valid C+ program. % . y main Function:- main() function is the entry point'of any.C program. It is the point at which execution of program is started. When a C program is executed, the execution control goes directly to the main() function. Every C program requires a main() function. Use of more than one main() function is illegal. Main() function has the following form. © main() 7 <> A © int mainQ) * void main() © main(void) © void main(void) © int méin(void) The empty pair of Parentheses indicates that the function has no arguments. This may be explicitly indicated by the keyword void inside the parentheses. We may also specify the keyword int or void ‘before the word main. The keyword void means that the function does not return any information to the operating system. When int is specified , the last statement in the program must ‘be ‘return 0” Proceduiral Programming Paradigm: - Procedural programming paradigm lays more emphasis on Procedure or the algorithm. Data is considered secondary, Data is loosely available to many functions, Limitations of procedural programming paradigm are: + _Itis susceptible to increased time and cost overheads during design changes, + It leads to increased time and cost overheads during design changes, * Procedural programming is unable to represent real world relationships that exist among objects. Prepared by: Monzur Ahmed 2) organized around the data being operated Object Oriented Programming: - In OOP the progran tc upon rather than the operations performed. The basic idea behind OOP is to combine both data and its functions that operate on the data in to a single unit called class. Difference Between OOP And Procedural Programming: - The difference between object oriented programming and procedural programming are:= 2 PEE EY LE eins on obj e81S TN Hers emphasis 8 on doing thinas Cunetions) BI] It follows bottom-up approach in program It follows top-down approach in program design. design. S data hiiding features prevents accidentally eee he eee change in da EB den A Its features like data encapsulation, Features like data encapsulation, polymorphism and inheritance are present. polymorphism and inheritance are not available. Character Sets: - Character set is set of valid characters that a language can recognize. A character represents any letters digits or any other sign. (C+ has the following character set Letters Space +=*/ VO] = a2 Tank’spaces) horizontalliaby can iret mie Any of the 256 ASCII character Token:-The smallest individual unit in a program is known as token. Tokens used in CH > Keywords > Identifier > Literals > Punctuators > operators’ Keywords: Keywords ae the certain reserved words that convey a spevial meaning tothe compile, These ae reserve for special purpose and must not be used as identifier name.eg for if. else Nts dar etc, : Udenifers: Identifies are programmer defined names given tothe various program elements such as variables, Functions arrays, objects, classes, et. It may contain digits, letters and undenoae art Freee with a letter or underscore. C+ is ease sensitive as it reals upper and lower ence ann differently. The following are some valid identifiers: 7 Pen timeS80 s2e2r3 _dos _HJI3_JK Prepared by: Monzur Ahmed

You might also like