Re: writing program from a book

From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 01/28/04


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)


Relevant Pages

  • Re: writing program from a book
    ... Somehow, I doubt that. ... > under unix!! ... and expecting it to compile properly and execute. ... corrected code to a forum that has knowledge of them. ...
    (comp.lang.c)
  • Re: writing program from a book
    ... Somehow, I doubt that. ... > under unix!! ... and expecting it to compile properly and execute. ... corrected code to a forum that has knowledge of them. ...
    (comp.unix.programmer)
  • Re: Harry Potter and The Oblivious Wizard
    ... prohibition put in place by an omnipotent God, ... you're expecting it to somehow make sense? ...
    (rec.arts.sf.written)
  • Re: DOS/UNIX/MAC files
    ... Yes, I do realize I can do that, but I KNOW I will encounter both UNIX and DOS formatted text files. ... I guess it somehow is able to check for file formatting, but perhaps it does it in a rough way and reads in part of the file prior to asking me the conversion question. ... There's /no/ guarantee that you won't find, say, Lf-delimited files on a Windows machine. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: vms versus solaris
    ... > It makes your point about there being 10 years more experience with UNIX ... The originators of VMS were able to mimic UNIX in any respect ... Makes it sound like Unix is old technology while VMS is somehow newer. ... Kind of like TCPIP on a VMS machine. ...
    (comp.os.vms)