-
-
Save qHack/080d3668ae448e04204208099e8f706b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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