delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/03/07:15:26

From: marcov AT toad DOT stack DOT nl (Marco van de Voort)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: variables
Date: 3 Sep 2001 10:54:10 GMT
Organization: Eindhoven University of Technology, The Netherlands
Lines: 20
Message-ID: <slrn9p6odt.2qst.marcov@toad.stack.nl>
References: <20010901131037 DOT 03480 DOT 00004579 AT mb-fp DOT aol DOT com>
NNTP-Posting-Host: toad.stack.nl
User-Agent: slrn/0.9.7.1 (FreeBSD)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <20010901131037 DOT 03480 DOT 00004579 AT mb-fp DOT aol DOT com>, Sterten wrote:
> why are variables not initialized as 0 ?

Because that is slow.

> is there any reason, why "int x" can be better than "int x=0"  ?

=0 takes time.

> why do we have to define variables at all ? In BASIC I can use
> variables without declaring them. (default = float)

That's why Basic is slow :-)

> I've read, that the new processors will have more registers.
> Then we might use register-variables much more often ?

The register directive is only a suggestion IIRC. The compiler will assign
addtional variables to registers based on weight.

- Raw text -


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