POV-Ray : Newsgroups : povray.binaries.programming : command line : Re: command line Server Time
25 Apr 2024 14:53:55 EDT (-0400)
  Re: command line  
From: Philippe Lhoste
Date: 12 Jul 2002 11:16:33
Message: <3d2ef2d1@news.povray.org>
"majucatur" <maj### [at] yahoocom> wrote:
> Another example:
>
> program.c - - - - -
>
> #include <math.h>
> #include <stdio.h>
>
> void main() {
>    float Var;
>    printf("\nA number :");
>    scanf("%f", Var);
>    printf("\n\nThe square root of %f is %f\n", Var, sqrt(Var));
>    getch();
> }
>
> - - - - -
>
> that's all, how can I compile this in the command line?

Ouch, it is off topic (since it will compile) but your program shows a very
common mistake:
scanf("%f", Var); should be scanf("%f", &Var); ie. you must give it the
address of the variable.

--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.