Hai Netlanders and Coders
Could some one please point out to me an example to delete an element in an array of structure?Is it same as deleting an element in an array.ie like this....???
// to delete an element in an array
#include<iostream.h>
#include<conio.h> // for clrscr() and getch()
void main()
{
clrscr();
int a[50],n,t,index,i;
cout<<"enter no of array:";
cin>>n;
for(i=0;i<=n;++i)
cin>>a[i];
cout<<"enter element to be deleted:";
cin>>t;
for(i=0;i<=n;++i)
{
if(a[i]==t)
index=i;
}
for(i=index;i<=n;++i)
a[i]=a[i+1]
cout<<"array";
for(i=0;i<=n;++i)
cout<<"a[i]<<"\n";
getch();
}