added the project files

This commit is contained in:
2024-06-28 09:25:34 -04:00
parent 0b8b0ee658
commit 84a1c84250
43 changed files with 1494 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#include <iostream>
#include <string>
#include <stdlib.h> // srand/rand
#include <sys/types.h> // getpid
#include <unistd.h>
using namespace std;
void createRandomRow(int*& row, int size) {
row = new int[size];
for (int i = 0; i < size; ++i) row[i] = rand()%100;
} // createRandomRow
int main(int argc, char* argv[]) {
int seed = getpid();
if ( argc == 2 ) seed = stoi(string{argv[1]});
srand(seed); // only seed the random number generator once!
int *row = nullptr;
int size = rand() % 5 + 5;
createRandomRow(row, size);
cout << "row: ";
for (int i = 0; i < size; ++i) cout << row[i] << ' ';
cout << endl;
delete [] row;
} // main