C++ by Sunbeam
C++ by Sunbeam
md 4/28/2020
Day 1
Agenda
. Language classifications
. Revision of C
. C++ Introduction
. Access specifier
. Structure and class
. Oops Introduction
Language
It contains tokens
Idenitifier, Keyword, Constant, operator, Separator
Language has its syntax an semantics.
It contains built in features( e.g pointer, security, math support ).
If we want to implement B.L. then we should use language.
We can use it to develop applications:
. CUI[ Console User Interface ]
. GUI[ Graphical User Interface ]
. Libraries[ glibc, boost ]
Language classifications
. Machine Language
Binary langauge( 1, 0 )
. Low Level Language
Assembly language
. High Level Language
C, C++, Java, Python
Classification of high level Languages
. Procedure Oriented Programming language( POP )
ALGOL, FORTRAN, PASCAL, BASIC, C etc.
"FORTRAN" is considered as first high level POP language.
All POP languages follows "TOP Down" approach
. Object oriented programming languages( OOP )
Simula, Smalltalk, C++, Java, C#, Python, Go
"Simula" is considered as first high level OOP language.
more than 2000 lang. are OO.
All OOP languages follows "Bottom UP" approach
. Object Based Programming Languages
Ada, Modula-2,Java Script, Visual Basic
"Ada" is first Object Based Programming Language.
1/4
Read Me.md 4/28/2020
Revision of C
Inventor : Dennis Ritchie
Development : Developed between(1969-1972) in AT&T Bell lab.
Infrastructure : On Unix OS and DEC-PDP-11 machine
It is Procedure Oriented Programming Language.
Extension of C file should be .c
ANSI is an organization whose job is to updating/standardizing language.
ANSI Standards
Before 89 : The C Programming Language. 1989 C89 1990 C90 1995 C95 1999 C99 2011 C11 2018 C18
Declaration and Definition
Implementation of function is called function defintion.
If we use function before defintiion then to instruct compier we must provide function signature above
the function call. It is called function declaration.
//Function Call
int result = sum( 10, 20 );
printf("Result : %d\n", result);
return 0;
}
2/4
Read Me.md 4/28/2020
If we implement function above function call then function implementation is considered as declaration
as well as definition.
#include<stdio.h>
//num1, num2 => Parameters
int sum( int num1, int num2 )//Decl. as well as Def.
{
int result = num1 + num2;
return result;
}
int main( void )
{
int result = sum( 10, 20 ); //10,20 => Arguments
printf("Result : %d\n", result);
return 0;
}
According to Dennis Ritchie, "Declaration" refers to the place where nature of the variable is described
but no storage is allocated.
"Definition" refers to the place where memort is assigned or allocated.
struct Point
{
//Declaration
int xPos;
int yPos;
};
int main( void )
{
3/4
Read Me.md 4/28/2020
4/4