Click here to Skip to main content
15,867,883 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: Please, I need encouragement :( Pin
trønderen5-Aug-22 11:16
trønderen5-Aug-22 11:16 
GeneralRe: Please, I need encouragement :( Pin
PIEBALDconsult5-Aug-22 11:30
mvePIEBALDconsult5-Aug-22 11:30 
GeneralRe: Please, I need encouragement :( Pin
trønderen5-Aug-22 12:52
trønderen5-Aug-22 12:52 
GeneralRe: Please, I need encouragement :( Pin
PIEBALDconsult5-Aug-22 13:09
mvePIEBALDconsult5-Aug-22 13:09 
GeneralRe: Please, I need encouragement :( Pin
theoldfool5-Aug-22 11:39
professionaltheoldfool5-Aug-22 11:39 
GeneralRe: Please, I need encouragement :( Pin
#realJSOP6-Aug-22 0:03
mve#realJSOP6-Aug-22 0:03 
GeneralRe: Please, I need encouragement :( Pin
0x01AA6-Aug-22 1:43
mve0x01AA6-Aug-22 1:43 
GeneralRe: Please, I need encouragement :( Pin
#realJSOP7-Aug-22 2:02
mve#realJSOP7-Aug-22 2:02 
If you want index-1, you can use this

return (--index);

The way you did it, index was decremented after the return (a "postfix decrement"). You want it to be decremented before it's returned (a "prefix decrementSmile | :) .

Prefix Increment and Decrement Operators | Microsoft Docs[^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: Please, I need encouragement :( Pin
DRHuff6-Aug-22 7:01
DRHuff6-Aug-22 7:01 
GeneralRe: Please, I need encouragement :( Pin
BernardIE531711-Aug-22 16:25
BernardIE531711-Aug-22 16:25 
GeneralWidows11 Pin
Slow Eddie5-Aug-22 3:05
professionalSlow Eddie5-Aug-22 3:05 
GeneralRe: Widows11 Pin
Maximilien5-Aug-22 3:20
Maximilien5-Aug-22 3:20 
GeneralRe: Widows11 Pin
Cp-Coder5-Aug-22 3:23
Cp-Coder5-Aug-22 3:23 
GeneralRe: Widows11 Pin
Nelek5-Aug-22 3:39
protectorNelek5-Aug-22 3:39 
GeneralRe: Widows11 Pin
Mike Hankey5-Aug-22 3:58
mveMike Hankey5-Aug-22 3:58 
GeneralRe: Widows11 Pin
jmaida5-Aug-22 8:27
jmaida5-Aug-22 8:27 
GeneralRe: Widows11 Pin
OriginalGriff5-Aug-22 4:05
mveOriginalGriff5-Aug-22 4:05 
GeneralRe: Widows11 Pin
Cp-Coder5-Aug-22 4:44
Cp-Coder5-Aug-22 4:44 
GeneralRe: Widows11 Pin
jsc425-Aug-22 4:53
professionaljsc425-Aug-22 4:53 
GeneralRe: Widows11 Pin
OriginalGriff5-Aug-22 4:56
mveOriginalGriff5-Aug-22 4:56 
GeneralRe: Widows11 Pin
charlieg5-Aug-22 14:54
charlieg5-Aug-22 14:54 
GeneralRe: Widows11 Pin
kmoorevs5-Aug-22 5:26
kmoorevs5-Aug-22 5:26 
GeneralRe: Widows11 Pin
theoldfool5-Aug-22 5:35
professionaltheoldfool5-Aug-22 5:35 
GeneralRe: Widows11 Pin
Gerry Schmitz5-Aug-22 5:50
mveGerry Schmitz5-Aug-22 5:50 
GeneralRe: Widows11 Pin
charlieg5-Aug-22 13:32
charlieg5-Aug-22 13:32 

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.