delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/24/00:05:58

Subject: Re: Need help with c!
Approved: clc AT plethora DOT net
References: <clcm-19990117-0010 AT plethora DOT net> <clcm-19990118-0001 AT plethora DOT net> <clcm-19990120-0006 AT plethora DOT net> <clcm-19990121-0005 AT plethora DOT net>
From: Francis Glassborow <francis AT robinton DOT demon DOT co DOT uk>
X-Newsreader: Turnpike (32) Version 3.05 <TilyaeicE$WmMOP9F8P4$y3lmP>
Organization: Southfield Microcomputer SS
Lines: 32
Mime-Version: 1.0
Newsgroups: comp.os.msdos.djgpp,comp.lang.c.moderated
Message-ID: <clcm-19990123-0004@plethora.net>
Originator: clcm AT plethora DOT net (Comp Lang C'Moderated)
Date: Sun, 24 Jan 1999 04:31:54 GMT
NNTP-Posting-Host: 205.166.146.5
X-Trace: ptah.visi.com 917152314 205.166.146.5 (Sat, 23 Jan 1999 22:31:54 CDT)
NNTP-Posting-Date: Sat, 23 Jan 1999 22:31:54 CDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <clcm-19990121-0005 AT plethora DOT net>, Francis Glassborow
<francis AT robinton DOT demon DOT co DOT uk> writes
>For the benefit of other readers, in an offline exchange I have
>ascertained that mohan is trying to execute his code with Windows98
>without realising that such code must be run in a DOS Box

I have just been asked to extend this comment.  I will be brief because
it is OS specific.   Windows98 is a multitasking system which really
hates programs that try to get at external resources (such as files)
behind its back.  You can compile your code as a console program if your
compiler provides support for this (of course you could always torture
yourself by doing it for yourself, but I am not such a masichist)  Of
course the compiler will happily compile calls to scanf, and the linker
will generate an executable.  However any attempt to execute the result
is doomed (unless it was compiled for and run under DOS).  In the case
in question the reason that the executable did not immediately fall over
when the input file was missing was that the FILE* was NULL (I think
there were still problems, but not such obvious ones as far as the OS
was concerned)

IF you want to learn C using Windows98 the investment in a compiler that
directly supports the OS is worth it.  If you are a student or
teacher/instructor check MetroWerks' academic licence and cost they
really are a bargain for an excellent package (which even includes
Pascal and, I believe, Objective C)

 

Francis Glassborow      Chair of Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
-- 
comp.lang.c.moderated - clcm AT plethora DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019