Bill Cunningham said:
%d is an int I can change it to %ld
Bill, if you insist on answering rhetorical questions then please
answer _all_ such questions levelled at you in a given post.
If you "can change it", why did you not do so prior to posting?
It's gcc so it is c99 compatible
That depends on what command-line arguments you drive it with.
What command-line arguments do you drive it with?
but then I don't think it's totally c99
compatible.
Don't "don't think" (although we can see you're very good at it).
Know, by Reading the Fu^Hine Manual.
You continue to aggravate those people who are trying to help you, by
failing to do the following:
1. Decide what problem you want to solve, or what output you want to
see for given input, in the program you're about to write. Leave
"making it more flexible" until after you've got the first version
working.
2. Read and understand the description in K&R2's Appendix for each
standard library function you decide to use. If you don't understand
how the function should be used, don't use it until you do (and gain
that understanding by asking specific questions about the aspects of
its use that you don't grok). Don't guess. Use the mechanisms
provided to check for anomalous conditions.
3. (As Barry said) Avoid C99-but-not-C90 features that provide no
significant benefit for your program, until full C99 compilers are
more widespread.
4. Compile your code with a compiler (and command-line arguments) that
gives you something as close as possible to a C90 or C99 compiler.
5. If you don't understand an error or warning message you get from
that compiler, post a query about the message, showing the message
itself, the full command-line you used, and the full source code that
triggers that message.
6. Modify your code to eliminate all error messages, and as many
warning messages as you can.
7. If you don't understand the runtime behaviour of your program, post
a query about the behaviour, showing the full command-line you used to
compile it, the full source code of your program, all messages
produced by the compiler, the full command-line you used to run your
program, all the input you supplied to it, and all the output it
gave. Describe precisely what you expected to see, and how what you
did see differs from that.
8. Judiciously follow suggestions given to you by posters here, and
provide feedback to let others know that you have done so.
If you start to do these things, two wonderful things will happen:
- you'll get more and better help
- you'll need less help
If you don't start to do these things, bad things (for you):
- people who can usefully help you will instead ignore you
- at best, you'll continue your current rate of improvement
mlp