I would like to know how to declare and call this function from within the main:
void Part1()
{
int array1[10];
int n;
int i;
for (i=1; i<=10; i++)
{
cout<<"Please enter an entry for position "<< i<<": "<<endl;
cin>>n;
array1[i] = n;
}
cout<<endl;
i = 0;
for (int i=0; i<10; i++)
{
cout<<array1[i]<<endl;
}
return 0;
}
When I try to run my int main() I get nothing. I am aware that void does not return anything, but I thought simply calling the function (ie "Part1") would work. What am I doing wrong?
EDIT: This is how I have been calling it:
int main (){
Part1;
system("PAUSE");
return 0;
}