

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This is code for a lab task of Data Structures course. Its main topic is Array Program Static Array. It was submitted to Amar Kumar at Amrita Vishwa Vidyapeetham. It includes: Array, Program, Static, Enter, Number, Loop, Dynamic, Fragments, Unsigned, Store, Location
Typology: Summaries
1 / 2
This page cannot be seen from the preview
Don't miss anything!


//ArrayProgram Static Array #include<iostream.h> void main() { int A[10],i; for(i=0;i<10;i++) { cout<<“Enter a number: “; cin>A[i]; } cout<<“\n Array Contents\n”; for(i=0;i<10;i++) { cout<<A[i]<<“ “; } }
char *p; unsigned int size; cin << size; unsigned int index = 0; p = new char[size];
//store in the array location
cin << value; if (index >= size) { cout << "Illegal Operation\n"; return; } p[index] = value; ++ index
// retrieve if (index >= size) { cout << "Illegal Operation\n"; return -1; } return p[index];
// get_size() return size;