Click here to Skip to main content
15,886,724 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
englebart16-Feb-22 14:52
professionalenglebart16-Feb-22 14:52 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha16-Feb-22 15:52
Memtha16-Feb-22 15:52 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
David O'Neil16-Feb-22 22:14
professionalDavid O'Neil16-Feb-22 22:14 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha17-Feb-22 5:23
Memtha17-Feb-22 5:23 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
trønderen17-Feb-22 6:40
trønderen17-Feb-22 6:40 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha17-Feb-22 6:53
Memtha17-Feb-22 6:53 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
David O'Neil16-Feb-22 22:22
professionalDavid O'Neil16-Feb-22 22:22 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Richard Deeming17-Feb-22 2:08
mveRichard Deeming17-Feb-22 2:08 
How about the simple case of removing items from a list within a forwards for loop? Smile | :)
C#
List<int> values = new() { 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 };

// Remove all even numbers:
for (int index = 0; index < values.Count; index++)
{
    if ((values[index] % 2) == 0)
    {
        values.RemoveAt(index);
    }
}

// Expected output: { 1, 3, 3, 3 }
// Actual output: { 1, 2, 3, 3, 3, 4, 4 }




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Oh boy. I've given myself a challenge now. Pin
FreedMalloc17-Feb-22 5:25
FreedMalloc17-Feb-22 5:25 
GeneralCCC 2022-02-16 Pin
Peter_in_278015-Feb-22 22:03
professionalPeter_in_278015-Feb-22 22:03 
GeneralRe: CCC 2022-02-16 Pin
OriginalGriff15-Feb-22 22:05
mveOriginalGriff15-Feb-22 22:05 
GeneralRe: CCC 2022-02-16 Pin
pkfox15-Feb-22 23:19
professionalpkfox15-Feb-22 23:19 
GeneralRe: CCC 2022-02-16 Pin
OriginalGriff15-Feb-22 23:25
mveOriginalGriff15-Feb-22 23:25 
GeneralRe: CCC 2022-02-16 Pin
pkfox16-Feb-22 3:38
professionalpkfox16-Feb-22 3:38 
GeneralRe: CCC 2022-02-16 Pin
Greg Utas16-Feb-22 1:00
professionalGreg Utas16-Feb-22 1:00 
GeneralRe: CCC 2022-02-16 - WINNER! Pin
Peter_in_278016-Feb-22 1:09
professionalPeter_in_278016-Feb-22 1:09 
GeneralRe: CCC 2022-02-16 - WINNER! Pin
Greg Utas16-Feb-22 1:13
professionalGreg Utas16-Feb-22 1:13 
GeneralRe: CCC 2022-02-16 - WINNER! Pin
Peter_in_278016-Feb-22 1:20
professionalPeter_in_278016-Feb-22 1:20 
GeneralRe: CCC 2022-02-16 - WINNER! Pin
OriginalGriff16-Feb-22 1:31
mveOriginalGriff16-Feb-22 1:31 
GeneralRe: CCC 2022-02-16 - WINNER! Pin
Peter_in_278016-Feb-22 1:31
professionalPeter_in_278016-Feb-22 1:31 
RantI'd have rather paid extra Pin
honey the codewitch15-Feb-22 19:08
mvahoney the codewitch15-Feb-22 19:08 
GeneralRe: I'd have rather paid extra Pin
Sander Rossel15-Feb-22 19:55
professionalSander Rossel15-Feb-22 19:55 
GeneralRe: I'd have rather paid extra Pin
den2k8815-Feb-22 20:51
professionalden2k8815-Feb-22 20:51 
GeneralRe: I'd have rather paid extra Pin
honey the codewitch16-Feb-22 0:51
mvahoney the codewitch16-Feb-22 0:51 
GeneralRe: I'd have rather paid extra Pin
englebart16-Feb-22 15:01
professionalenglebart16-Feb-22 15:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.