#include<iostream>
#include <iomanip>
#include<vector>
#include "d_util.h"
using namespace std;
template <typename T>
void writeVector(const vector<T>& v);
int main()
{
vector<int>v;
for (int n=0; n<=9; n++)
{
printf("A number between 0 and 9: %d\n", rand()%9);;
v.push_back(n);
n = v.size();
for(int i = 0; i < n; i++)
cout << v[i] << " ";
cout << endl;
}
writeVector(v);
return 0;
}
This program runs and executes perfectly, however i need v.push_back to push back the random numbers and the writeVector to write the random numbers.
can anybody point in that direction.
This post has been edited by Videege: 26 October 2006 - 09:54 AM

New Topic/Question
Reply




MultiQuote



|