hi i am meriiiiiiiiii
i ma the beginer and i want to know how to build such a function to insert an element in an array pls help.......
Move all the elements of the array after the new one up one and insert the new element. Alternatively, create a new array, copy the elements over, including the inserted one, and delete the old array.
thanks..........but i want to know code
Ah - you want me to do your homework for you. No deal. If you can't do simple coding like this take up a different course - computer programming is not your thing.
i,m also a beginner but i guess i can help u
for(i=n;i>=pos;i++)
{
a[i+1]=a[i];
n++;
}
a[pos]=k;
for(i=0;i<n;i++)
cout<<a[i];
hmmmmmmmmmm ! amazing u are also a beginner I also felt. In first for loop i would be dicrimented not incrimented.
thanks 4 replying.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |