Skip to content

Instantly share code, notes, and snippets.

@qHack
Forked from anonymous/hw9
Last active October 16, 2016 21:33
Show Gist options
  • Save qHack/080d3668ae448e04204208099e8f706b to your computer and use it in GitHub Desktop.
Save qHack/080d3668ae448e04204208099e8f706b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iomanip>
using namespace std;
int SIZE;
int * arrayEx (int * array, int SIZE);
int main() {
int array[SIZE];
int s;
cout << "enter the size" << endl;
cin >> SIZE;
cout << "enter the numbers in the array" << endl;
for ( int i = 0; i < SIZE; i++)
cin >> array[i];
int * double_array = arrayEx(array, SIZE);
for (int i = 0; i < SIZE *2; i++)
cout << *(double_array + i) <<endl;
}
int * arrayEx (int * array, int SIZE) {
int s;
s = SIZE*2;
int* n = new int[s];
for (int i = 0; i < SIZE ; i++)
*(n+i) = array[i];
return n;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment