

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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;