Re: [Dev-C++] Problem with Writefile
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Luigi S. <gi...@li...> - 2001-09-01 17:26:46
|
Hello J.Schuhmacher, I would like to help you but I don't know what the "WriteFile" is, maybe it is some ANSI C/C++ function that I'm missing? Please let me know. If you wish to convert an integer into a string you could use the function "itoa" (Integer TO Array). I've found such a function in the file "stdlib.h" shipped with the mingw compiler (or with Dev-C++) but as far as I remember "itoa" is not an ANSI-C function (of course I may be wrong), so if portability is important to you I suggest you not use it. I use instead a version of "itoa" that can be found at www.geocities.com/gisan1/src_fram.htm/ Hope this helps At 17.22 31/08/01 +0200, you wrote: >Hello, i am using the writefile to place strings into a textfile from a >consol app ! > >The following works normally > >char *pstr; >pstr = "Prozess - Protokoll \n "; >WriteFile(hfile, pstr, 25, &dwWritten, NULL); > >And I also can write value of e.g. "int a" by > >WriteFile(hfile, &a, 1, &dwWritten, NULL); > > >But it appears as one byte only - unreadable in text browser. > >Now, how can I write it in ASCII - ? > >How CAN I convert an e.g. integer to a string ? > >I remember from DOS Programming, there was a function. > >thanks for a hint > >j.s. > > > > > >---------------- >J.Schuhmacher >jsc...@gm... > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users -- gisan gi...@li... |