Re: rand() & Microsoft ??!!!
Your passing '&pass' (the address of the pointer) as opposed to 'pass' which is the pointer to the data.
Code:
void GeneratePass( const char* passPath, size_t units ){
std::ofstream passFile;
size_t *pass = new size_t[units];
srand( __time32_t(NULL) );
for( size_t C = 0; C < units; C++ )
pass[C] = rand();
passFile.open( passPath, std::ios::binary );
passFile.write( reinterpret_cast<char*>(pass), units * sizeof(size_t) );
passFile.close();
delete[] pass;
return;
}
Re: rand() & Microsoft ??!!!
Thanks alot *io* ,
it works fine now.