Hello! I am a newbie in C programming.
I think this question is better to be put here.
I am using DEV C++ 4.992 and reading C Primer Plus as my starting up. By testing a little program about Specifiers, I begin to have some questions.
The problem is that the program cannot read %ll specifier from a printf function correctly.
At first, I thought this is MinGW's problem and then I realize that it is the problem of Windows. I found some post on MinGW that in Windows %I64d is the answer. They said it is related to MSVCRT.dll something. I don't quite understand the operations actually.
The question is, what is the relationship of MSVCRT and printf function? Is it OS independent? Say, eg, in Linux, the syntax is a bit different?
in Windows, use %I64d for 64-bit specifier
in Linux, use %ll
I think simliar problem will come again.
If so, if I am learning my programming and want to understanding more and avoid simple but questionable problem like this, what and where should I read more?
Any opinion and help is appreciated
Thanks a lot!
Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello! I am a newbie in C programming.
I think this question is better to be put here.
I am using DEV C++ 4.992 and reading C Primer Plus as my starting up. By testing a little program about Specifiers, I begin to have some questions.
The problem is that the program cannot read %ll specifier from a printf function correctly.
At first, I thought this is MinGW's problem and then I realize that it is the problem of Windows. I found some post on MinGW that in Windows %I64d is the answer. They said it is related to MSVCRT.dll something. I don't quite understand the operations actually.
The question is, what is the relationship of MSVCRT and printf function? Is it OS independent? Say, eg, in Linux, the syntax is a bit different?
in Windows, use %I64d for 64-bit specifier
in Linux, use %ll
I think simliar problem will come again.
If so, if I am learning my programming and want to understanding more and avoid simple but questionable problem like this, what and where should I read more?
Any opinion and help is appreciated
Thanks a lot!
Simon
Simon,
I suggest you do a search over in the Bloodshed forum, the topic of printing long long has come up there several times before.
Wayne