delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/19/06:45:14

From: "Bill McNeely" <wmcneely AT san DOT rr DOT com>
Newsgroups: alt.comp.lang.learn.c-c++,comp.os.msdos.djgpp
Subject: Instead of goto???
Date: Thu, 18 Dec 1997 20:02:03 -0800
Organization: Time Warner
Lines: 44
Message-ID: <67crk0$kre$1@prefetch.san.rr.com>
References: <348a15e5 DOT 826895 AT news DOT clear DOT net DOT nz> <01bd0a80$b482bb00$a47de3c7 AT merlyn> <3496C249 DOT 263D AT cs DOT com>
NNTP-Posting-Host: dt031n50.san.rr.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Just getting started in programming... and seeing goto in many of the
samples of code that I have looked at from other programmers...I have yet to
find a better way to control display of information.

For example I have used a goto statement and displayed some information then
used the getch() to hold the screen until key hit (I am aware of the kbhit()
command) for display screens, such as ego screens.  Any recommendations on a
better way to accomplish the same thing.

I am using TC++ 3.0.  Thanks for any ideas.

Bill McNeely
wmcneely AT san DOT rr DOT com

John M. Aldrich wrote in message <3496C249 DOT 263D AT cs DOT com>...
>~liquid~ wrote:
>>
>> I thought that the object oriented nature of C++ would give it a leg up
on the older version?
>> I haven't learned C yet but I've read a book on C++ and it emphisized the
introduction of new
>> statements allowing for more "bug free" programming by constraining it to
limit the uses.
>> a prime example is the "goto" statement.. From what I've read it should
be avoided as much as possible
>
>Few self-respecting C programmers will use 'goto'.  :-)  I think the
>ultimate answer to this question lies not in the language itself, but in
>the programmer's use of the language.  It's just as easy to write
>mangled C++ code as it is to write mangled C code, and it is
>mathematically provable that anything written in C++ can be rewritten to
>function identically in C.
>
>Try both, see what you like the best, and work from there.
>
>--
>---------------------------------------------------------------------
>|      John M. Aldrich       | "Autocracy is based on the assumption|
>|       aka Fighteer I       | that one man is wiser than a million |
>|   mailto:fighteer AT cs DOT com   | men.  Let's play that over again,    |
>| http://www.cs.com/fighteer | too.  Who decides?"   - Lazarus Long |
>---------------------------------------------------------------------


- Raw text -


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