Re: variable initialization / I'm a n00b



John Smith wrote On 01/31/07 13:42,:
rjtucke wrote:

Hi all- this is my first post here- just a quick question:

#include <math.h>
double foo = cosh(0.621);
int main() {
return 0;
}

fails with

error: initializer element is not constant

In addition to telling me what I'm doing wrong, could you please refer
me to an appropriate reference for related questions? I've been doing
my reading (open net + safari bookshelf), but I don't know where to
look. Even if I have to (sigh) buy a book, I would appreciate your
pointers.

Thanks and regards,
Ross



"K&R" is "The C Programming Language" by Brian Kernighan & Dennis
Ritchie. Ritchie is the inventor of C and this is the definitive

s/this is/this was/

book on the language. If you are already familiar with
programming in general, it's a good place to start learning C. If
not, there are books better oriented to beginners.

K&R ceased to be the definitive work on C some seventeen
and a half years ago. Still, it's better reading than the
more recent definitive works.

--
Eric.Sosman@xxxxxxx
.



Relevant Pages

  • Re: variable initialization / Im a n00b
    ... initializer element is not constant ... Ritchie is the inventor of C and this is the definitive ... it's better reading than the ...
    (comp.lang.c)
  • Re: variable initialization / Im a n00b
    ... int main{ ... initializer element is not constant ... Ritchie is the inventor of C and this is the definitive book on the language. ...
    (comp.lang.c)
  • Re: counting number of records in a Fortran direct file
    ... >> but I cannot afford the time cost. ... > Maybe somebody else knows of a portable solution that doesn't ... > involve reading the file, but off-hand I'd try reading the ... > up again with a smaller step until it fails, ...
    (comp.lang.fortran)
  • Re: Heinlein/Clarke Recommendations
    ... Hm, I like cats, I respect cats, I identify with them.. ... reading, if you like Miles or the series. ... If the age difference and explicit scenes aren't squicky to you then ... But it fails as a fantasy and it fails as a romance. ...
    (rec.arts.sf.written)
  • Re: If you solve the mystery, are you disappointed?
    ... before the story's sleuth indicates they have figured it out or tells ... If the author is clearly trying to fool me, and fails, and they fail because the clues are too obvious, then I'm mildly disappointed. ... But if the story is a good one and not overfamiliar, I'm more than willing to keep reading. ...
    (rec.arts.mystery)