SlideShare a Scribd company logo
GOVERNMENT POLYTECHNIC,
AHMEDABAD
Advance Computer
Programming(3320702)
Chapter 1:- Array & String
SHAH YATRI B (166170307097)
VARIA JAHNVI (166170307117)
VAISHNANI BANSI D
(166170307113)
VAGHELA HEENA
M(166170307112)
SONI ITISHREE J (166170307104)
SUBMITTED
BY
ARRAY & STRING
ARRAY
CHARACTERISTICS OF
ARRAY:-
• Fixed size
• Comman name
• Same datatype
• Logically related data
• Sequencial storage
Array is a fixed size sequencial collection of related
variables having same datatype and sharing comman name
 OPERATION OF
ARRAY
• Merging
• Sorting
• Inserting
• Deleting
• Searching
 ADVANTAGES OF
ARRAY• One name to store many variables
• Useful while working with sequncial data
• It makes program easy to read write and debug
 DISADVANTAGES OF
ARRAY• Wastage of memory
• Only one datatype
• Sometimes not easy to operate
1-DIMENSIONAL ARRAY
• Declaration
:-
Datatype
arrayname[size];• Initializatio
n :-
arrayname[index]={val
ue};• Dynamic
Initialization :-
Datatype arrayname[size]=
{value};
CHARACTER ARRAY
• Declaration
:-
char arrayname[size];
• Initializatio
n :-
arrayname[index]={val
ue};• Dynamic
Initialization :-
char
arrayname[size]={value};
2-DIMENSIONAL ARRAY
Datatype
arrayname[rowsize][columnsize];
• Declaration
:-• Initializatio
n :-
• Dynamic
Initialization :-
arrayname[rowindex][columnindex]=
{value};
Datatype arrayname[rowindex][columnsize]=
{value};
MULTI-DIMENSIONAL ARRAY
• Declaration
:-
Datatype arrayname[1-Dsize][2-
Dsize][N-Dsize];
STRING HANDLING FUNCTION
FUNCTION
NAME
DETAILS
strcat() Concat two strings
strcpy() Copy two strings
strcmp() Compare two strings
strlen() To know the length of string
strncpy() To copy string upto n
strncmp() To compare string upto n
strncat() To concate string upto n
strcmpi() To compare string insensitivly
strrev() To reverse the string
strupr() To convert string in upper case
strlwr() To convert string in lower case
strstr() To match two strings
strchr() To match character in string

More Related Content

Similar to array and strings

Similar to array and strings (6)

Apdm 101 Arc Gis Pipeline Data Model (1)
Apdm 101 Arc Gis Pipeline Data Model  (1)Apdm 101 Arc Gis Pipeline Data Model  (1)
Apdm 101 Arc Gis Pipeline Data Model (1)
 
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
 
dsa.ppt
dsa.pptdsa.ppt
dsa.ppt
 
dsa.ppt
dsa.pptdsa.ppt
dsa.ppt
 
dsa (1).ppt
dsa (1).pptdsa (1).ppt
dsa (1).ppt
 
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
 

Recently uploaded

Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DrGurudutt
 

Recently uploaded (20)

Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdfONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
 
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and ClusteringKIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
retail automation billing system ppt.pptx
retail automation billing system ppt.pptxretail automation billing system ppt.pptx
retail automation billing system ppt.pptx
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 

array and strings

  • 1. GOVERNMENT POLYTECHNIC, AHMEDABAD Advance Computer Programming(3320702) Chapter 1:- Array & String SHAH YATRI B (166170307097) VARIA JAHNVI (166170307117) VAISHNANI BANSI D (166170307113) VAGHELA HEENA M(166170307112) SONI ITISHREE J (166170307104) SUBMITTED BY
  • 3. ARRAY CHARACTERISTICS OF ARRAY:- • Fixed size • Comman name • Same datatype • Logically related data • Sequencial storage Array is a fixed size sequencial collection of related variables having same datatype and sharing comman name  OPERATION OF ARRAY • Merging • Sorting • Inserting • Deleting • Searching
  • 4.  ADVANTAGES OF ARRAY• One name to store many variables • Useful while working with sequncial data • It makes program easy to read write and debug  DISADVANTAGES OF ARRAY• Wastage of memory • Only one datatype • Sometimes not easy to operate
  • 5. 1-DIMENSIONAL ARRAY • Declaration :- Datatype arrayname[size];• Initializatio n :- arrayname[index]={val ue};• Dynamic Initialization :- Datatype arrayname[size]= {value}; CHARACTER ARRAY • Declaration :- char arrayname[size]; • Initializatio n :- arrayname[index]={val ue};• Dynamic Initialization :- char arrayname[size]={value};
  • 6. 2-DIMENSIONAL ARRAY Datatype arrayname[rowsize][columnsize]; • Declaration :-• Initializatio n :- • Dynamic Initialization :- arrayname[rowindex][columnindex]= {value}; Datatype arrayname[rowindex][columnsize]= {value}; MULTI-DIMENSIONAL ARRAY • Declaration :- Datatype arrayname[1-Dsize][2- Dsize][N-Dsize];
  • 7. STRING HANDLING FUNCTION FUNCTION NAME DETAILS strcat() Concat two strings strcpy() Copy two strings strcmp() Compare two strings strlen() To know the length of string strncpy() To copy string upto n strncmp() To compare string upto n strncat() To concate string upto n strcmpi() To compare string insensitivly strrev() To reverse the string strupr() To convert string in upper case strlwr() To convert string in lower case strstr() To match two strings strchr() To match character in string