Hi everybody, I am new to the programming world and I have an assignment that I need to write an array then a new array that needs to allocated dynamically and, then, populated in reverse order before being displayed all within a function.
Here is what I have so far
#include "stdafx.h"
#include <iostream>
using namespace std;
void main()
{
int array1[6] = {2, 4, 6, 8, 10, 12};
int *nums = array1;
cout << "The numbers are:\n";
cout << *nums << " ";
while(nums < &array1[5])
{
nums++;
cout<< *nums << " ";
}
// I know this is where the dyn. allocating comes in but how?
system("pause");
return;