This doesnt make sense, why do have a semi-colan at the end and what code would you like to execute inside the while loop ?
Code:
while(numValues < 128);
Why have you declared a function inside main ? And where is this function displayArray ?
Code:
void displayArray(int nArray[], int nSize)
hmmm.... try this code
Code:
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(int argc, char* argv[])
{
int value;
int numValues = 0;
int inputValues[128];
do
{
cout << "Enter a value into the array: ";
cin >> value;
if (value < 0)
break;
inputValues[numValues++] = value;
}while(1);
cout <<"The value of the array is:\n";
for (int i=0; i < numValues; i++)
{
cout <<i<<": "<<inputValues[i]<<"\n";
}
cout <<"\n";
system("PAUSE");
return 0;
}