Re: Pointer question.

From: Alf P. Steinbach (alfps_at_start.no)
Date: 03/27/05


Date: Sun, 27 Mar 2005 00:04:43 GMT


* Gregory L. Hansen:
>
> I want to check on something. For a float, f and a pointer to float,
> fptr, are the statements
>
> *fptr = f;

Assigns to the float that fptr points to.

> fptr = &f;

Assigns to fptr the address of f.

If you now do

  *fptr = 3.14;

you assign 3.14 to f because fptr now points to (contains the address of) f.

 
> the same thing?

No.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


Relevant Pages

  • Re: Pointer question.
    ... For a float, f and a pointer to float, ... I always forget just what it means to have *fptr on the ... I think the pointer pointed to something when I tried ... "Let us learn to dream, gentlemen, then perhaps we shall find the ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Pointer question.
    ... "Gregory L. Hansen" wrote in message ... > pointer to float, fptr, are the statements ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Pointer question.
    ... Gregory L. Hansen wrote: ... For a float, f and a pointer to float, ... *fptr = f; ... assigns the address of f to the pointer fptr. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: =?ISO-8859-15?Q?W=E4re_Alonso_f=FCr_Ferrari_gut??=
    ... float* fptr ... "Drivers are just interchangeable light bulbs - you plug them in and ...
    (de.rec.sport.motorsport.formel1)
  • Re: Any undefined behavior???
    ... extern float window; ... float *fptr; ...
    (comp.lang.c)