K
Keith Thompson
The above was written by Richard Heathfield. Please leave attribution
lines in place; they make it substantially easier to follow the
conversation (and quoting someone else's words without attribution is
considered rude).
The line above:
is an attribution line. There should have been a similar one
crediting RH for what he wrote.
The following is slightly off-topic, since it deals with specific
implemntations rather than with the language.
"gcc" originally stood for "GNU C Compiler"; it was later changed to
"GNU Compiler Collection". The name "gcc" refers to a collection of
compilers for various languages. It's also the command name used to
invoke the C compiler portion of the gcc system (yes, it's a bit
confusing). "g++" is the command used to invoke the C++ compiler.
If you're compiling C code, use the "gcc" command, *not* the "g++"
command. (If you really want to program in C++, that's fine; use the
"g++" command, but ask about it in comp.lang.c++.)
Richard's advices is very good. Remove *all* the casts, use "gcc"
rather than "g++" to compile your sources, and try to correct any
problems *without* adding casts. There are cases where casts are
appropriate, but I don't think any of them occur in your program.
If you end up with something that you just can't get to compile, post
it here along with the *exact* copy-and-pasted error messages, and we
can help. If you end up with something that compiles but doesn't
work, post it here and tell us *exactly* how it doesn't work.
lines in place; they make it substantially easier to follow the
conversation (and quoting someone else's words without attribution is
considered rude).
The line above:
is an attribution line. There should have been a similar one
crediting RH for what he wrote.
I don't think we are; we're using g++, which I am told is the only
thing we have. I tried to use cc, but it doesn't seem to be on the
system.
The following is slightly off-topic, since it deals with specific
implemntations rather than with the language.
"gcc" originally stood for "GNU C Compiler"; it was later changed to
"GNU Compiler Collection". The name "gcc" refers to a collection of
compilers for various languages. It's also the command name used to
invoke the C compiler portion of the gcc system (yes, it's a bit
confusing). "g++" is the command used to invoke the C++ compiler.
If you're compiling C code, use the "gcc" command, *not* the "g++"
command. (If you really want to program in C++, that's fine; use the
"g++" command, but ask about it in comp.lang.c++.)
Richard's advices is very good. Remove *all* the casts, use "gcc"
rather than "g++" to compile your sources, and try to correct any
problems *without* adding casts. There are cases where casts are
appropriate, but I don't think any of them occur in your program.
If you end up with something that you just can't get to compile, post
it here along with the *exact* copy-and-pasted error messages, and we
can help. If you end up with something that compiles but doesn't
work, post it here and tell us *exactly* how it doesn't work.