Hi this is program I created for making a user defined array.
This is only a small part of my project and I would like to make it into a static function named 'input(n)',where n is the size of the array.
int main() {
int* a=0;
int n,x;
std::cout<<"Enter size ";
std:: cin>>n;
std::cout<<"Enter elements ";
a=new int(n);
for(int i=0;i<n;i++){
std::cin>>x;
a[i]=x;
}
for(int j=0;j<n;j++ ){std::cout<<a[j];}
getch();
}
Any hints on how to get it started?