.dat ASCII file I/O in C++ -


I have a .dat file with the following images such as ASCII characters:

Enter image details here

This is basically a series of 16-bit numbers. I can read it as unsigned less in my data structure, but I do not know how to save my unsigned less as input. This is my current code, although the value is correct, the format is not. See the following image:

Enter image details here

any Any ideas I have about how should I save it as input format? This is my saving task. "

  Zero SavePxlShort (vector & lieutenant; point 3d> & amp;; p; char * fileName) {offream OS (filename, iOS :: Out) ; Size_t l = pts.size (& lt; & lt; "......" & lt; & lt; endl; for unsigned short pxl; (long time i = 0; i   endl ;} And {cout ; pixel intensity overflow user "& lt; endl; return;}} osclose (); return;}  

  zero service Xcel Short (Vector & Lt; Point 3D & gt; & amp; pts; char * fileName) {ofstream os (fileName, ios :: out, ios :: binary & lt; & lt; l & lt; & lt; "......" & lt; & l; lt & lt; & lt; ct & lt; "writing data (pixels with length)" u nsigned short * pData = New unsigned short [L]; unsigned short for pxl; (tall I = 0; i  (piedata), shape (unsigned short) * l); Os.close (); Delete PData; Return; }  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -