int delete(struct Array *arr, int index)
{
int x=0;
int i;
if (index >= 0 && index < arr->length)
{
x = arr-> A[index];
for(i = index; i<arr->length-1; i++)
arr ->length--;
return x;
}
return 0;
}
int main()
{
struct Array arr= {{2,3,4,5,6},10,5};
printf("%d\n", Delete(&arr,4));
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter