Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Incrementing int passed by reference



Ian Bell <[EMAIL PROTECTED]> wrote:
> I am passing the address of an int into a function.  I want to increment the
> int.  Code snippet

> void foo(int * pc)
> {
>     *pc++;
> }

> pc does not get incremented.

> Is this a funny precedence thing with *?

Yes.  I'll leave it as an exercise to you to find out how to fix up the
precedence. ;->

-- 
Hans-Bernhard Broeker ([EMAIL PROTECTED])
Even if all the snow were burnt, ashes would remain.
-- 
comp.lang.c.moderated - moderation address: [EMAIL PROTECTED]



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.