Re: Newbie pointer question



"seegoon" <seegoon99@xxxxxxxxx> wrote in message
news:1153808204.312536.317260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all.
I was wondering what the advantage of using pointers are( Programming
in 'C' ).For instance : I have a simple embedded controller
application
, turning a few io on and off , maybe some serial comms etc.
I can create variables (Global or local) and then access them directly
, or can access them via pointers , but is there any advantages. Does
the compiler generate more efficient code?
In simple applications "is" there any advantage to using pointers?
Can any one "Point" me in the right direction , haa haa.

In addition to Mark's excellent answer I can add the following
real-world example in which a button on my GUI may display one of a
number of different images on it depending on which language is
selected.

The image data is stored in a large array which is part of a Bitmap
structure. Rather than have to decide which language is in use and then
which picture to draw every time the button is drawn, I have a pointer
which points to whichever Bitmap structure is current. I then draw the
button image pointed to which removes the need for a decision on every
redraw. The only time the pointer is modified is when the language is
changed.


.