|
-
February 10th, 2008, 10:47 PM
#1
-
February 11th, 2008, 03:19 AM
#2
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;
}
-
February 11th, 2008, 05:37 AM
#3
Re: rand() & Microsoft ??!!!
Thanks alot *io* ,
it works fine now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|