delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/25/22:17:12

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ctor ?
Date: Tue, 22 Jul 1997 21:55:57 -0700
Organization: Alcyone Systems
Lines: 26
Message-ID: <33D58EDD.3CBEF5A7@alcyone.com>
References: <199707100209 DOT AA214490589 AT typhoon DOT rose DOT hp DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Andrew Crabtree wrote:

>  If I compile the following code
> 
>  #include <stdio.h>
>  int f()
>  {
>  return 5;
>  }
> 
>  int x = f();
	...
>  As C the compiler complains that it is using a non-constant
>  initializer.

This is a valid complaint -- you are not writing good ANSI C.  In C, an
initializer (what's on the right side of the = sign when you are defining
a variable) must be a compile-time constant.

-- 
       Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
                     Alcyone Systems /   web / http://www.alcyone.com/max/
San Jose, California, United States /  icbm / 37 20 07 N  121 53 38 W
                                   \
   "Love is not love which alters / when it alternation finds."
                                 / William Shakespeare, _Sonnets_, 116

- Raw text -


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