L Value required error-Trying to increment array elements using element address

Discussion in 'C Programming' started by soby000, Mar 23, 2009.

  1. soby000

    soby000

    Joined:
    Mar 23, 2009
    Messages:
    1
    for(i = 0; i < ARRAY_SIZE; i++)
    {
    *(array + i)++;

    if ( *(array + i) >= 10)
    {
    *(array + i) = 0;
    }
    }


    line is bold is the error line.It alows me below to using *(array...) just not where i increment it.Any ideas??Btw in the program im not allowed use subscripts i.e [] thats why im using + i.
    Thanks
    soby000, Mar 23, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jrefactors@hotmail.com

    why prefix increment is faster than postfix increment?

    jrefactors@hotmail.com, Oct 22, 2005, in forum: C Programming
    Replies:
    104
    Views:
    10,995
    Jordan Abel
    Oct 28, 2005
  2. jrefactors@hotmail.com
    Replies:
    99
    Views:
    2,491
    eliza81
    Jun 11, 2010
  3. candide
    Replies:
    65
    Views:
    1,398
    jameskuyper@verizon.net
    May 29, 2008
  4. Alf P. Steinbach /Usenet
    Replies:
    0
    Views:
    889
    Alf P. Steinbach /Usenet
    May 22, 2011
  5. Peng Yu

    post increment or pre increment?

    Peng Yu, Nov 21, 2008, in forum: Perl Misc
    Replies:
    7
    Views:
    518
    Peter J. Holzer
    Nov 23, 2008
Loading...

Share This Page