MicroBit - Plus Two Computer Science Chapters 1 & 2
MicroBit - Plus Two Computer Science Chapters 1 & 2
STRUCTURE
! &
POINTERS
!
Mohammed Jaseem.N
9605 502058
1.Array vs Structure (4 Points) 3.Variable Declaration & m/y
Allocation
2.Structure Declaration
Struct
struct tagname variable;
tag name
E =>
tagname variable;
I ;
Struct tagname
struct Student E
[int roll no ; & variable
Char name 20] ;
,
4.Accessing Structure Elements 5.Nested Structure
1
S1 =
Ajay" ; Definition
.
-
S1 Vollno 9;
Example
.
= -
-
or -
Si = Ea "Asay", ,
POINTER
1.Pointer 2.Pointer Declaration
Definition datatpe -
pointer;
& -
address
of eg : int +
p;
* value at/indirection
identity error
-
int p ; Float * k; k =
Sp ;
error
Mismatching of data type
3.Static VS Dynamic m/y Alloc 4.Pointer & Operator
(5 point) Arithmetic : +
== ! =
new : Allocation
delete : de Allocation 5.Pointer & Array
memory leakage A
way name itself a
pointer
Differentiate : le ; Base Address
Int *
p = new int 10
;
int a T5 = 2 5 , 10 , 15 20 , , 253 ;
7 5 20 25
identity
10 15 A
error *
p + 2; G I 2 3 4
5
Int *
p = new
float ; *
4;
15 1000
*
p+2 ;
P
6.Pointer & String 7.Pointer &Structure
char AP = "INDIA"; Access : Arrow
char name 28
j
Student * next ;
I ;
Questions:
1 .
2
.
Dynamic Array
Runtime
Array is allocated during
eg : int * p = new Int [10] ;
IntC ;
eg :
"
C12 > 3 ;
Int * new Int ;
p
=
2
-
&
.
CONCEPT
!!! OF
OBJECT ORIENTED
!....!!!
PROGRAMMING
! Ni
oops concepts
a) object -
Instance
b) class -
blueprint prototype
Syntas
Class Classname
3 private i =>
=>
public :
protected : =>
I ,
1) Data Abstraction :
Hiding
d) Data Encapsulation :
wrapping/Binding
I visibility
private
public Access specifier
protected Mode
Base class
parent Super
New class Devided child subclass
Type of Inheritance
diagram
-
compulsary
Static Dynamic
Compile time Runtime Late Bindly
I
early Binding
virtual function
Function operator
Structure Class
2 pop vs
oop
5
points collection
of different collection
of
3
Advantage of oop elements
different elements
functions