attaching a random number to an array

so here's the deal in my class assignment I'm supposed to generate a random number and use it to open a file in an array from my input file... but I don't really know what to do... I've opened my input file and used a while loop with an array in it to retain all of the values but i don't know how to attach the values after that... help? Here's what i have so far

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;



int std_dev(int variance);


int main(int argc, char *argv[])
{
double z[999];
double other[999];
int a, b;
float mean;
unsigned int seed;
ifstream zarray;
zarray.open("normal_distribution.txt");
srand(seed);



cout << "enter the mean value in the array " << endl;
cin >> mean;
cout << "your mean value is " << mean << endl;


cout << "enter a random number seed" << endl;
cin >> seed;
cout << "your seed is " << seed << endl;

zarray >> a;
zarray >> b;

srand()%999;

while( ! zarray.eof() )
{
zarray >> other[999];

zarray >> z[999];

}
Topic archived. No new replies allowed.