100% found this document useful (1 vote)
1K views6 pages

MicroBit - Plus Two Computer Science Chapters 1 & 2

Uploaded by

hishaam2949
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views6 pages

MicroBit - Plus Two Computer Science Chapters 1 & 2

Uploaded by

hishaam2949
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1!

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 ;

int * Int 10 Int * 000 , 004 , 008 01 016


p = new ; p= a ; 1
, , ,

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

< har * Sub 3 =


3 "Thy" ,
"she", Student * S1 = new student ;
"Maths" 3; S1-name "
=
Babu" ;
Si vollno = 10 ;
structure
self referential
When a member of a structure is a
pointer to the

Same structure itself


.
struc Student
eg :

& int vollno ;

char name 28
j
Student * next ;

I ;

Questions:
1 .

Identify the error


Can't
student Intialize
&Int roll no = 9; values

char name [20 ;

2
.
Dynamic Array
Runtime
Array is allocated during
eg : int * p = new Int [10] ;
IntC ;
eg :

"

cout1)" Enter the value of (: ;

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

e) Modularity sub divided Decomposed


5)Inheritance
aquiring
Exsiting class :

Base class
parent Super
New class Devided child subclass

Type of Inheritance
diagram
-
compulsary

9) polymorphism (many from


Type of Polymorphism

Static Dynamic
Compile time Runtime Late Bindly
I
early Binding
virtual function

Function operator

overloading overloading 1- class vs structure

Structure Class
2 pop vs
oop
5
points collection
of different collection
of
3
Advantage of oop elements
different elements

Limitation of Pop keyword : Struct objects


Contains 1 section keyword : class

(public by default Contains 3 sections

Data members only (private public protected


, ,

Data members I member

functions

You might also like