Re: writing program from a book
From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 01/28/04
- Next message: Rich Teer: "Re: writing program from a book"
- Previous message: Jens.Toerring_at_physik.fu-berlin.de: "Re: writing program from a book"
- In reply to: hpy_awad_at_yahoo.com: "writing program from a book"
- Next in thread: Default User: "Re: writing program from a book"
- Reply: Default User: "Re: writing program from a book"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 14:23:43 -0500
hpy_awad@yahoo.com wrote:
> I wrote that program from a book that my compile that program
> correctly under C++ compiler
Somehow, I doubt that.
> but I got those errors for compiling
> under unix !!
The code you transcribed here is /so/ wrong.
You are compiling bad K&R (pre-ANSI) C with ANSI C99 / C++ comments using a
C++ compiler, and expecting it to compile properly and execute.
1) This is not C++, so stop using a C++ compiler on it
2) This is not C99, so lose the C++style comments
3) There are logic errors in your code. Fix them
(for instance, you never assign a value to your 'options' variable,
you test the 'options' variable for a value that can never occur,
etc.)
4) You use platform-specific functions; either lose them or submit your
corrected code to a forum that has knowledge of them.
-- Lew Pitcher, IT Consultant, Application Architecture Enterprise Technology Solutions, TD Bank Financial Group (Opinions expressed here are my own, not my employer's)
- Next message: Rich Teer: "Re: writing program from a book"
- Previous message: Jens.Toerring_at_physik.fu-berlin.de: "Re: writing program from a book"
- In reply to: hpy_awad_at_yahoo.com: "writing program from a book"
- Next in thread: Default User: "Re: writing program from a book"
- Reply: Default User: "Re: writing program from a book"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|