C++ Program wont function with any number larger than 100, WHY?

#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <cmath>

using namespace std;


void printRandArray(long long int blup[])
{

cout << "A random array of numbers: \n\n";
srand((unsigned int)time(0));
for (long long int j = 0; j < 100; j++)
{
blup[j] = (rand() % 10000) + 1;
cout << blup[j] << endl;


}

}


void sort(long long int blupblup[], long long int size)
{
int itemp = 0;

for (long long int i = 0; i < size - 1; i++)
for (long long int j = i + 1; j < size; j++)
if (blupblup[i] > blupblup[j])
{
itemp = blupblup[i];
blupblup[i] = blupblup[j];
blupblup[j] = itemp;
}
}


void printArray(long long int blupblupblup[], long long int size)
{

cout << "\n\nThe sort of the aforementioned array is: \n\n";

for (long long int i = 0; i < size; i++)
{
cout << blupblupblup[i] << endl;
}
}


int main(long long int argc, char* argv[])
{
ifstream in;

in.open("Array.dat");

const long long int size = 100;
long long int array[size];

printRandArray(array);
sort(array, size);
printArray(array, size);

return 0;
}
Ok, to be more specific. The array works just fine with 100 for size but if you enter anything larger than 100 it will not print the unsorted, or if it is printing it it will not display it because I think its deleting it half way through the cycle. I need it to sort 500, and 10000. Please help!
Topic archived. No new replies allowed.