On Sun, 7 Jun 1998, Glynn Clements wrote:

> 
> Ibrahim Haddad wrote:
> 
> > > Can you please try to explain what you are trying to do? (type casting
> > > is most likely the wrong thing to do here).
> > 
> > I an generating 2 floating number (sample number: 12.193). 
> > I need to write these numbers in a file called "bcocomo-log"
> > in the following format:
> > num1  num2
> > num3  num4
> > num5  num6
> > and so on
> > 
> > That's all.
> 
> In which case you need to use something like:
> 
>       fprintf(fp, "%f %f\n", num1, num2);
> 
> to write them and
> 
>       fscanf(fp, "%f %f\n", &num1, &num2);
> 
> to read them.
> 
> -- 
> Glynn Clements <[EMAIL PROTECTED]>
> 
        I would put them in a loop so they ask for an input of 2 float
numbers and enter them as float with:

        scanf("%f %f", &num1, &num2);

Then I would put them on the screen with this:

        printf("%f %f\n", num1, num2):


        I don't understand the fprintf() format. Is this one you use
Glynn?





Best wishes 

   - Karl F. Larsen, 3310 East Street, Las Cruces,NM (505) 524-3303  -

Reply via email to