Pointer to a text file

  • Thread starter Thread starter MyCatAlex
  • Start date Start date
M

MyCatAlex

Guest
Well, It should be a simple thing but nothing works what I've tried. I have a brand new SSD where I defined a file "SphHarm.dat". I included this file into my project. All I need is to load (write) a large number of floating point numbers to this file. The numbers should be written back to back, so pointer type operation is preferred. Subsequently another part of the program will read the values in this file one by one many times.

LPCWSTR SphHarm = L"SphHarm.dat";
HANDLE hMyFileHandle;
hMyFileHandle = CreateFile(
SphHarm,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);

But in fact I need a float type pointer to the file. That will allow me to use memcpy function to write those floating point numbers one by one back to back. How can I get it?

Thanks - MyCatAlex

Continue reading...
 
Back
Top