### Creating New Numbers in a Random Array

So I posted this earlier to receive OOP help with my code, but I dropped the Object Oriented programming aspect. My goal is to create an array of ten random integers and sort them in order. Problem is, we need to do this in 3 different languages. I only know Java and BASIC. C++ is new to me. I have everything working on my code EXCEPT that I don't get new numbers when I run the code:
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051`` ``````#include using namespace std; int sort (); int arrayValue; int array [10]; int temp; /** * Compares the value of two elements in myArray[] * and sorts them in order by value */ int sort () { for(int y = 0; y < 10; y ++) { for(int j = 0; j < 10; j ++) { if (array[j+1] > array[j]) { temp = array[j]; array[j] = array[j+1]; array[j+1] = temp; } } } for(int t = 0; t < 10; t ++) { cout << array[t]; cout << " "; } while(1); } /** * The main () method starts everything */ int main () { for(int x = 0; x < 10; x ++) { array[x] = rand() % 100; cout << array[x]; cout << " "; } cout << " "; sort (); // Runs the sort () method }``````

Any suggestions on how to create new numbers when I run this?
P.S Remember I am very new to C++
Seed the random number generator, once, right at the beginning of main.

`std::srand( std::time(0) ) ; // #include <ctime> `

http://en.cppreference.com/w/cpp/numeric/random/srand
Can you explain it in terms of my code? I'm not asking for the answer, but I don't know what to put where.
@Hydracronis

Like this..

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364`` ``````// Random array numbers.cpp : main project file. #include #include using namespace std; int sort (); int arrayValue; int array [10]; int temp; /** * Compares the value of two elements in myArray[] * and sorts them in order by value */ /** * The main () method starts everything */ int main () { srand((unsigned) time(0)); // To use the random function and get // different numbers, using time cout << endl << endl << "Unsorted numbers in array" << endl; for(int x = 0; x < 10; x ++) { array[x] = rand() % 100; cout << array[x]; cout << " "; } cout << " "; sort (); // Runs the sort () method } int sort () { for(int y = 0; y < 10; y ++) { for(int j = 0; j < 9; j ++) // Needs to be 1 less than array size // else array out of bounds with j+1 { if (array[j+1] > array[j]) { temp = array[j]; array[j] = array[j+1]; array[j+1] = temp; } } } cout << endl << endl << "Sorted numbers in the array" << endl; for(int t = 0; t < 10; t ++) { cout << array[t]; cout << " "; } cout << endl << endl; return 0; }``````
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354`` ``````#include //included for time(NULL) #include #include //included for rand and srand functions using namespace std; int sort (); int arrayValue; int array [10]; int temp; /** * Compares the value of two elements in myArray[] * and sorts them in order by value */ int sort () { for(int y = 0; y < 10; y ++) { for(int j = 0; j < 10; j ++) { if (array[j+1] > array[j]) { temp = array[j]; array[j] = array[j+1]; array[j+1] = temp; } } } for(int t = 0; t < 10; t ++) { cout << array[t]; cout << " "; } while(1); } /** * The main () method starts everything */ int main () { srand(time(NULL)); //randomizes seed based on time for(int x = 0; x < 10; x ++) { array[x] = rand() % 100; cout << array[x]; cout << " "; } cout << " "; sort (); // Runs the sort () method }``````