|
Prev: Which inclue file to use to use the winapi. Not using stdafx or MFC.
Next: Problem with compilation
From: Daniel on 24 Apr 2008 08:43 I'm trying to write to a file using fprintf_s a value of type unsigned long long, using the format specifiers "%ld". However, when I open the text file, I see incorrect values. I think I am using the wrong type specifiers. I can't find the correct information in the help section. Does anyone know what format specifiers I need to use? Here is my code: fprintf_s(cfPtr, "%lu\n", number);
From: Igor Tandetnik on 24 Apr 2008 08:56 "Daniel" <Mahonri(a)cableone.net> wrote in message news:OKy0ejgpIHA.3456(a)TK2MSFTNGP05.phx.gbl > I'm trying to write to a file using fprintf_s a value of type > unsigned long long, using the format specifiers "%ld" %ld is plain vanilla long. You want %llu or %I64u -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
From: Daniel on 24 Apr 2008 13:04 I just tried those two suggestions, but I still get the same problem. "Igor Tandetnik" <itandetnik(a)mvps.org> wrote in message news:erh%23kqgpIHA.672(a)TK2MSFTNGP02.phx.gbl... > "Daniel" <Mahonri(a)cableone.net> wrote in message > news:OKy0ejgpIHA.3456(a)TK2MSFTNGP05.phx.gbl >> I'm trying to write to a file using fprintf_s a value of type >> unsigned long long, using the format specifiers "%ld" > > %ld is plain vanilla long. You want %llu or %I64u > -- > With best wishes, > Igor Tandetnik > > With sufficient thrust, pigs fly just fine. However, this is not > necessarily a good idea. It is hard to be sure where they are going to > land, and it could be dangerous sitting under them as they fly > overhead. -- RFC 1925 >
From: Igor Tandetnik on 24 Apr 2008 16:09 "Daniel" <Mahonri(a)cableone.net> wrote in message news:u3VJP1ipIHA.3408(a)TK2MSFTNGP03.phx.gbl > I just tried those two suggestions, but I still get the same problem. Show your code, what you expect to see, and what you actually see in the file. -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
From: Tamas Demjen on 24 Apr 2008 18:33 Igor Tandetnik wrote: >> I'm trying to write to a file using fprintf_s a value of type >> unsigned long long, using the format specifiers "%ld" > > %ld is plain vanilla long. You want %llu or %I64u It's very hard to be 100% portable with this: VC++: %I64u or %llu GNU g++, Solaris: %llu Borland: %Lu or I64u Tom
|
Next
|
Last
Pages: 1 2 Prev: Which inclue file to use to use the winapi. Not using stdafx or MFC. Next: Problem with compilation |