I have the following program...........
int insert(int *array, int arraySize, int newElement)
{
array[arraySize + 1] = newElement;
return (arraySize+1); // Return new Array size......
}
int main()
{
int array[] = {1,2,3,4,5};
int arraySize = sizeof(array) / sizeof(int);
insertInArray(array, arraySize,6);
print(array);
}
I am trying to work out this program in C programming language... But when i print the array after insertion,,, it doesn't prints the desired output which is needed..
Please correct me if i am doing something wrong.....
Thanks..