From: Jorge A. <jab...@ma...> - 2003-07-04 09:44:48
|
Hello Guys!! Again, thanks for the help and the - how could I say?, enlightening?- discussion. Daniel's solution worked alright and, what the hell?, I was happy, as I consider myself a beginner and my window program worked. However, Per remarks were really good to understand what was going on. I believe we should shoot for the excellency, therefore, I tried the following code: /////// for (loop=0;loop<Number_of_Points;loop++) { DWORD dWritten; sprintf (temp,"%3d \r\n",ran1[loop]); WriteFile(hFile, temp, strlen(temp),&dWritten, NULL); } ////// and it worked, too! just for you to know: a) in the first version I had: char temp[3], now I changed to 100. b) the goal was to write an ascii file, not a binary. Just for anybody interested, the program I wrote is to calculate random numbers according to 3 different types of probability density functions (I will include more in the future). Types supported are uniform, gaussian, and rayleigh. I don't have any problem sharing it and, as I am sure it contains many bugs, receive comments to improve it!!! JE |