Hi 
I dont think that using pointers can be faster than
using local variables. 
In some case,s it might be equal but can never be
faster. 
In case of accessing the memory for pointer needs to
access the data on the heap and there is one
indirection also involved. 
Bit on case of normal variables they are accessed
using direct stack memory.

Please give your comments.

Thanks 
Ishtiyaq


--- Darryl Sumner <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> Pointers are in a lot of cases faster to use than
> variables. As stated in a previous post, type *name
> declares a pointer, pointers can only point to the
> type declared unless cast to another type. Be
> careful
> with casting though. Their are two other unary
> operators for pointers, the & and the *. The & is
> the
> "address of operator". Ex: p=&variable name;
> The other operator is *, "at address". Ex: cout <<
> *p
> << endl; This will print what the value of the
> variable pointer to is.
> 
> Ex: int *p,value=100;
>     p=&value;
>     printf("%d",*p) //prints 100
>     printf(p) //will print the address not 100
> 
> This also just scratches the surface though. I like
> books by Herb Schildt, he's easy to understand and
> detailed.
> Hope this helps,
> Darryl 
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Dress up your holiday email, Hollywood style. Learn
> more. 
> http://celebrity.mail.yahoo.com
> 
> 
> 
> 



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250





>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at 
http://www.eScribe.com/software/C-Paradise/

>------------------------------------------_->


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/C-Paradise/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to