sigh

This is a discussion on sigh within the C++ Programming forums, part of the General Programming Boards category; lets say u have the array [ 3 4 5 ] and u want to change the 3 to a ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    18

    sigh

    lets say u have the array
    [ 3 4 5 ]
    and u want to change the 3 to a 4
    or the first integer to a unit higher
    [ 4 4 5 ]

    a longer array is

    [ 1 2 3 4 5 6 7 8 ]

    After being ran through the program should be
    [ 2 2 3 4 5 6 7 8 ]

    understand

    It will really look like

    345
    &
    445

    but I put the [ ]'s to signify thats the array

    Like a liscence plate but I also have something that has 3 digits then another that has 5 digits so you dont just take the array and add 100 or whatever to get the first digit a higher unit...
    HACKERS MANIFESTO (NOTE MOST WAS CUT OFF) (PEOPLE SAID IT WAS TOO LONG)
    This is our world now... the world of the electron and the switch, the beauty of the baud.
    We make use of a service already existing withoutpaying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals.
    We explore... and you call us criminals.
    We seek after knowledge... and you call us criminals.
    We exist without skin color, without nationality, without religious bias... and you call us criminals.
    You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals.

    Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.

    I am a hacker, and this is my manifesto. You may stop this individual,but you can't stop us all... after all, we're all alike.
    +++The Mentor+++

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    All you are doing is incrementing the value at the subscript of 0.

    For an array of integers x, you want to perform this operation...
    x[0]++;
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Hey!

    Reply to your older post, not create a new one. Heck, you only posted it 2 hours before this one...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why is this function not working? Sigh...
    By musique in forum C++ Programming
    Replies: 16
    Last Post: 05-03-2009, 05:54 PM
  2. Sigh, Brainfart. Controlling how += operator is used?
    By Zeusbwr in forum C# Programming
    Replies: 8
    Last Post: 11-09-2005, 09:11 PM
  3. Extreme hardware control...sigh...
    By jinx in forum C++ Programming
    Replies: 5
    Last Post: 04-29-2004, 02:40 PM
  4. sigh... why dosent this work?
    By jon_nc17 in forum C++ Programming
    Replies: 3
    Last Post: 05-20-2002, 09:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21