SlideShare une entreprise Scribd logo
1  sur  15
Declarations & Definitions 
struct employee 
{ 
char n ; 
int a ; 
float s ; 
} ; 
struct employee e 
Compulsory 
= { ”Rahul”, 25, 4000.50 } ; 
OR 
[20] 
Optional 
struct employee 
{ 
char n[20] ; int a ; float s ; 
} e = { ”R ahul”, 25, 4000.50 } , x, y 
;
Copying 
main( ) 
{ struct emp 
{ 
char n[20] ; 
int a ; 
float s ; 
} ; 
struct emp e1 = { ”Rahul”, 23, 4000.50 } ; 
struct emp e2, e3 ; 
e2.n = e1.n ; 
strcpy strcpy ( ( ) ) ;; 
e2.a = e1.a ; 
e2.s = e1.s ; 
e3 = e1 ; 
printf ( ”%s %d %f”, e3.n, e3.a, e3.s ) ; 
} 
piecemeal 
copying 
copying at 
one shot 
e2.n, e1.n
Copying Arrays 
int a[10] = { 3, 6, 5, … } ; 
int b[10] ; 
for ( i = 0 ; i <= 9 ; i++ ) 
b[i] = a[i] ; 
struct z 
{ 
int arr[10] ; 
} ; 
struct z b ; 
struct z a 
b = a ; 
OR 
= { 3, 6, 5, ... } ;
Nested Structures 
main( ) 
{ struct address 
{ 
char city[20] ; 
long int pin; 
} ; 
struct emp 
{ 
char n[20] ; 
f - int 
printf ( ”%d”, a.b.c.d.e.f ) ; 
struct emp e = { ”Rahul”, 23, ”Nagpur”, 440010, 
4000.50 } ; 
printf ( ”%s %d%s%ld%f”, e.n, 
} 
e.age, e.pin, 
e.s ) ; 
e.city, 
int age ; 
struct address a ; float s ; 
} ; 
ee..aa..ppiinn 
ee..aa..cciittyy aa..cciittyy
Passing Structure Elements 
main( ) 
{ 
struct book 
{ 
char n[20] ; int nop ; float pr ; 
} ; 
struct book b = { ”Basic”, 425, 135.00 } ; 
display ( b.n, b.nop,b.pr ) ; 
show } ( b.n, &b.nop, &b.pr ) ; 
display ( char *n, int pg, float p ) 
{ 
} printf ( ”%s %d %f”, n, pg, p ) ; 
show ( char *n, int *pg, float *p ) 
{ 
printf ( ”%s %d %f”, n, *pg, *p ) ; 
}
( * b b ) .n, 
main( ) 
{ 
struct book 
{ 
char n[20] ; int nop ; float pr ; 
} ; 
struct book b = { ”Basic”, 425, 135.00 } ; 
display1 ( b ) ; show1 ( &b ) ; 
} display1 ( ) 
{ 
} printf ( ”%s %d %f”, 
show1 ( ) 
{ printf ( ”%s %d %f”, 
} 
Passing Structures 
struct book bb 
bb.n, bb.nop, bb.pr ) ; 
struct book *bb 
( * ) 
bb .nop, 
( * ) 
bb .pr ) ; 
printf ( ”%s %d %f”, bb -> n , bb -> nop, 
bb -> pr ) ;
main( ) 
{ 
struct com 
{ 
float r, i ; 
} ; 
struct com a 
struct com b = { 1.2, 1.7 } ; 
struct com add ( struct com, struct com ) ; 
c = add ( a, b ) ; 
printf ( ”%f %f”, c.r, c.i ) ; 
} 
add ( struct com x, struct com y ) 
} 
Complex Nos. 
struct com c ; 
struct com z ; 
x.r + y.r ; 
x.i + y.i ; 
= { 2.5, 1.3 } ; 
struct com add ( struct com x, struct com y ) 
{ 
z.= x.+ y.r ; 
z.= x.+ y.i ; 
return z ;
Applications of Structures 
 Database Management 
 Positioning Cursors 
 Receiving ascii and scan codes 
 Displaying characters 
 Printing on printer 
 Mouse Programming 
 Graphics Programming 
 All Disk Operations 
 etc.
Floppy Disks 
JJaacckkeett 
WWrriittee PPrrootteecctt nnoottcchh 
PPllaatttteerr (( mmyyllaarr )) 
HHuubb rriinngg 
RReeaadd // WWrriittee sslloott 
RReettrraaccttaabbllee mmeettaall sshheeaatthh 
Access to magnetic surface 
Access to magnetic surface 
Platter ( only when retracted ) 
( mylar ) 
( only when retracted ) 
WWrriittee PPrrootteecctt nnoottcchh 
Platter 
( mylar )
Hard Disk 
SSppiinnddllee 
RReeaadd // WWrriittee HHeeaadd 
HHeeaadd AAsssseemmbbllyy 
PPllaatttteerr (( aalluummiinniiuumm ))
SSeeccttoorrss 
Parts of Platter 
ooff ssaammee ccaappaacciittyy 
TTrraacckkss
Specs Of Floppy Disks 
Type 
360 KB 
1.2 MB 
1.44 MB 
Sides 
222 
Trk/side 
40 
80 
80 
Sec/Trk 
9 
15 
18 
Dia. 
5 1/4 ” 
5 1/4 ” 
3 1/2 ” 
TPI 
48 
96 
135 
Name 
DSDD-D9 
HD-QD15 
2HD-QD18 
BByytteess // SSeeccttoorr ffoorr aannyy ddiisskk == 551122 
CCaappaacciittyy ooff DD99 ddiisskk == 
22 ** 4400 ** 99 ** 551122 // 11002244 
336600 KKBB
Logical Organization 
17 
18 
1 
2 
11 
10 
Boot 
Sector 
Boot 
Sector 
3 
6 5 4 
D 
F2 
SSiiddee 00,, TTrraacckk 00 SSiiddee 11,, TTrraacckk 00 
F1 
7 
11 
F1 
8 
10 
9 
12 
13 14 15 
16 
17 
18 
1 
3 
2 
6 5 4 
7 
8 
9 
12 
13 14 15 
16 
D 
D 
D D D 
D 
D 
D 
D 
D 
D D D 
F1 
F1 
F1 F1 F1 
F1 
F1 
F2 
F2 F2 F2 
F2 
F2 
F2 
F2
main( ) 
{ 
Reading Boot Sector 
char arr [ 512 ] ; int i ; 
printf ( ”Enter floppy in drive A, 
press any key …” ) ; 
getch( ) ; 
absread ( ) ; 
0, 1, 0, arr 
for ( i = 0 ; i  512 ; i++ ) 
printf ( ”%c”, arr [ i ] ) ; 
Boot Sector 11 
SSiiddee 00,, TTrraacckk 00 
#include ”dos.h” 
}
CChhaapptteerr 1100 
CChhaapptteerr 1100

Contenu connexe

Tendances (19)

C questions
C questionsC questions
C questions
 
Implementing string
Implementing stringImplementing string
Implementing string
 
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
Arrays
ArraysArrays
Arrays
 
Include
IncludeInclude
Include
 
Chat code
Chat codeChat code
Chat code
 
Cquestions
Cquestions Cquestions
Cquestions
 
Implementation of c string functions
Implementation of c string functionsImplementation of c string functions
Implementation of c string functions
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
CQL 实现
CQL 实现CQL 实现
CQL 实现
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
week-16x
week-16xweek-16x
week-16x
 
5 1. character processing
5 1. character processing5 1. character processing
5 1. character processing
 
Function basics
Function basicsFunction basics
Function basics
 
C++ programming
C++ programmingC++ programming
C++ programming
 
MongoDB
MongoDBMongoDB
MongoDB
 
Avl tree
Avl treeAvl tree
Avl tree
 

En vedette (18)

Vcs9
Vcs9Vcs9
Vcs9
 
B-TREE PREPARED BY M V BRAHMANANDA REDDY
B-TREE PREPARED BY M V BRAHMANANDA REDDYB-TREE PREPARED BY M V BRAHMANANDA REDDY
B-TREE PREPARED BY M V BRAHMANANDA REDDY
 
Vcs29
Vcs29Vcs29
Vcs29
 
List build linked in - jigsaw - salesforce - free tools
List build   linked in - jigsaw - salesforce - free toolsList build   linked in - jigsaw - salesforce - free tools
List build linked in - jigsaw - salesforce - free tools
 
Gincana
GincanaGincana
Gincana
 
STACKS AND QUEUES CONCEPTS
STACKS AND QUEUES CONCEPTSSTACKS AND QUEUES CONCEPTS
STACKS AND QUEUES CONCEPTS
 
Vcs12
Vcs12Vcs12
Vcs12
 
Vcs4
Vcs4Vcs4
Vcs4
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
Vcs8
Vcs8Vcs8
Vcs8
 
Presentation Ukay Metal Ind.Pvt.Ltd.-Ashok 7-2015
Presentation Ukay Metal Ind.Pvt.Ltd.-Ashok  7-2015Presentation Ukay Metal Ind.Pvt.Ltd.-Ashok  7-2015
Presentation Ukay Metal Ind.Pvt.Ltd.-Ashok 7-2015
 
Presentation ukay 2014 - ashok 05.2014
Presentation ukay 2014 - ashok  05.2014Presentation ukay 2014 - ashok  05.2014
Presentation ukay 2014 - ashok 05.2014
 
Presentation ukay ashok 2-2015
Presentation ukay  ashok  2-2015Presentation ukay  ashok  2-2015
Presentation ukay ashok 2-2015
 
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
 
Vcs26
Vcs26Vcs26
Vcs26
 
Presentation ukay 2014 - ashok 17.02.2014
Presentation ukay 2014 - ashok  17.02.2014Presentation ukay 2014 - ashok  17.02.2014
Presentation ukay 2014 - ashok 17.02.2014
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
RIM(Reaction Injection Moulding)
RIM(Reaction Injection Moulding)RIM(Reaction Injection Moulding)
RIM(Reaction Injection Moulding)
 

Similaire à Vcs23

VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab ManualAkhilaaReddy
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfJason Garber
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Jaydip JK
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming LanguageArkadeep Dey
 
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...GkhanGirgin3
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
C tech questions
C tech questionsC tech questions
C tech questionsvijay00791
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscationguest9006ab
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with PythonHan Lee
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semesterDOSONKA Group
 

Similaire à Vcs23 (20)

VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby Conf
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
 
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
 
Java operators
Java operatorsJava operators
Java operators
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
C program
C programC program
C program
 
C tech questions
C tech questionsC tech questions
C tech questions
 
pointers 1
pointers 1pointers 1
pointers 1
 
Operators
OperatorsOperators
Operators
 
Struct examples
Struct examplesStruct examples
Struct examples
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
 
lets play with "c"..!!! :):)
lets play with "c"..!!! :):)lets play with "c"..!!! :):)
lets play with "c"..!!! :):)
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
 

Plus de Malikireddy Bramhananda Reddy

DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYMalikireddy Bramhananda Reddy
 
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYDATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYMalikireddy Bramhananda Reddy
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit orderMalikireddy Bramhananda Reddy
 

Plus de Malikireddy Bramhananda Reddy (20)

M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
 
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDYAVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
 
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYDATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1
 
Data representation UNIT-1
Data representation UNIT-1Data representation UNIT-1
Data representation UNIT-1
 
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
Vcs28
Vcs28Vcs28
Vcs28
 
Vcs24
Vcs24Vcs24
Vcs24
 
Vcs22
Vcs22Vcs22
Vcs22
 
Vcs21
Vcs21Vcs21
Vcs21
 
Vcs20
Vcs20Vcs20
Vcs20
 
Vcs19
Vcs19Vcs19
Vcs19
 
Vcs17
Vcs17Vcs17
Vcs17
 
Vcs15
Vcs15Vcs15
Vcs15
 
Vcs14
Vcs14Vcs14
Vcs14
 

Vcs23

  • 1. Declarations & Definitions struct employee { char n ; int a ; float s ; } ; struct employee e Compulsory = { ”Rahul”, 25, 4000.50 } ; OR [20] Optional struct employee { char n[20] ; int a ; float s ; } e = { ”R ahul”, 25, 4000.50 } , x, y ;
  • 2. Copying main( ) { struct emp { char n[20] ; int a ; float s ; } ; struct emp e1 = { ”Rahul”, 23, 4000.50 } ; struct emp e2, e3 ; e2.n = e1.n ; strcpy strcpy ( ( ) ) ;; e2.a = e1.a ; e2.s = e1.s ; e3 = e1 ; printf ( ”%s %d %f”, e3.n, e3.a, e3.s ) ; } piecemeal copying copying at one shot e2.n, e1.n
  • 3. Copying Arrays int a[10] = { 3, 6, 5, … } ; int b[10] ; for ( i = 0 ; i <= 9 ; i++ ) b[i] = a[i] ; struct z { int arr[10] ; } ; struct z b ; struct z a b = a ; OR = { 3, 6, 5, ... } ;
  • 4. Nested Structures main( ) { struct address { char city[20] ; long int pin; } ; struct emp { char n[20] ; f - int printf ( ”%d”, a.b.c.d.e.f ) ; struct emp e = { ”Rahul”, 23, ”Nagpur”, 440010, 4000.50 } ; printf ( ”%s %d%s%ld%f”, e.n, } e.age, e.pin, e.s ) ; e.city, int age ; struct address a ; float s ; } ; ee..aa..ppiinn ee..aa..cciittyy aa..cciittyy
  • 5. Passing Structure Elements main( ) { struct book { char n[20] ; int nop ; float pr ; } ; struct book b = { ”Basic”, 425, 135.00 } ; display ( b.n, b.nop,b.pr ) ; show } ( b.n, &b.nop, &b.pr ) ; display ( char *n, int pg, float p ) { } printf ( ”%s %d %f”, n, pg, p ) ; show ( char *n, int *pg, float *p ) { printf ( ”%s %d %f”, n, *pg, *p ) ; }
  • 6. ( * b b ) .n, main( ) { struct book { char n[20] ; int nop ; float pr ; } ; struct book b = { ”Basic”, 425, 135.00 } ; display1 ( b ) ; show1 ( &b ) ; } display1 ( ) { } printf ( ”%s %d %f”, show1 ( ) { printf ( ”%s %d %f”, } Passing Structures struct book bb bb.n, bb.nop, bb.pr ) ; struct book *bb ( * ) bb .nop, ( * ) bb .pr ) ; printf ( ”%s %d %f”, bb -> n , bb -> nop, bb -> pr ) ;
  • 7. main( ) { struct com { float r, i ; } ; struct com a struct com b = { 1.2, 1.7 } ; struct com add ( struct com, struct com ) ; c = add ( a, b ) ; printf ( ”%f %f”, c.r, c.i ) ; } add ( struct com x, struct com y ) } Complex Nos. struct com c ; struct com z ; x.r + y.r ; x.i + y.i ; = { 2.5, 1.3 } ; struct com add ( struct com x, struct com y ) { z.= x.+ y.r ; z.= x.+ y.i ; return z ;
  • 8. Applications of Structures Database Management Positioning Cursors Receiving ascii and scan codes Displaying characters Printing on printer Mouse Programming Graphics Programming All Disk Operations etc.
  • 9. Floppy Disks JJaacckkeett WWrriittee PPrrootteecctt nnoottcchh PPllaatttteerr (( mmyyllaarr )) HHuubb rriinngg RReeaadd // WWrriittee sslloott RReettrraaccttaabbllee mmeettaall sshheeaatthh Access to magnetic surface Access to magnetic surface Platter ( only when retracted ) ( mylar ) ( only when retracted ) WWrriittee PPrrootteecctt nnoottcchh Platter ( mylar )
  • 10. Hard Disk SSppiinnddllee RReeaadd // WWrriittee HHeeaadd HHeeaadd AAsssseemmbbllyy PPllaatttteerr (( aalluummiinniiuumm ))
  • 11. SSeeccttoorrss Parts of Platter ooff ssaammee ccaappaacciittyy TTrraacckkss
  • 12. Specs Of Floppy Disks Type 360 KB 1.2 MB 1.44 MB Sides 222 Trk/side 40 80 80 Sec/Trk 9 15 18 Dia. 5 1/4 ” 5 1/4 ” 3 1/2 ” TPI 48 96 135 Name DSDD-D9 HD-QD15 2HD-QD18 BByytteess // SSeeccttoorr ffoorr aannyy ddiisskk == 551122 CCaappaacciittyy ooff DD99 ddiisskk == 22 ** 4400 ** 99 ** 551122 // 11002244 336600 KKBB
  • 13. Logical Organization 17 18 1 2 11 10 Boot Sector Boot Sector 3 6 5 4 D F2 SSiiddee 00,, TTrraacckk 00 SSiiddee 11,, TTrraacckk 00 F1 7 11 F1 8 10 9 12 13 14 15 16 17 18 1 3 2 6 5 4 7 8 9 12 13 14 15 16 D D D D D D D D D D D D D F1 F1 F1 F1 F1 F1 F1 F2 F2 F2 F2 F2 F2 F2 F2
  • 14. main( ) { Reading Boot Sector char arr [ 512 ] ; int i ; printf ( ”Enter floppy in drive A, press any key …” ) ; getch( ) ; absread ( ) ; 0, 1, 0, arr for ( i = 0 ; i 512 ; i++ ) printf ( ”%c”, arr [ i ] ) ; Boot Sector 11 SSiiddee 00,, TTrraacckk 00 #include ”dos.h” }