Click here to Skip to main content
15,903,523 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Set Runtime Option problem Pin
Mike Upton5-Jul-02 0:48
Mike Upton5-Jul-02 0:48 
GeneralRe: Set Runtime Option problem Pin
CaesarCZ5-Jul-02 7:21
CaesarCZ5-Jul-02 7:21 
GeneralRe: Set Runtime Option problem Pin
chen5-Jul-02 14:22
chen5-Jul-02 14:22 
Generalmdi Pin
4-Jul-02 23:01
suss4-Jul-02 23:01 
Generalresizing a window Pin
slah4-Jul-02 22:50
slah4-Jul-02 22:50 
GeneralRe: resizing a window Pin
Mike Upton5-Jul-02 0:59
Mike Upton5-Jul-02 0:59 
GeneralRe: resizing a window Pin
Iain Clarke, Warrior Programmer5-Jul-02 1:05
Iain Clarke, Warrior Programmer5-Jul-02 1:05 
Generaliterators & vectors & moral Pin
Bernhard4-Jul-02 22:38
Bernhard4-Jul-02 22:38 
my coworker uses stuff like this all over the code
vector<int> test;
vector<int>::iterator i;

// he wants to skip the first 10 elements
for (i = test.begin() + 10; i < test.end(); ++i)
{
    ....
}

// or stuff like this if he wants to skip the last 10 elements
i = test.begin();
if ( test.begin() + 10 < test.end())
    i += 10;


he asked me something bout this.. and i told him that this is not the proper way to do this (i think of having read that you never never never should another comparison than != for the end() function of a vector).. but actually i don't know any other way to skip 10 elements with one command..

is this proper code ?
what would be a safer way ? (if it isn't proper code ?)

thanks in advance,
bernhard



"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
GeneralRe: iterators & vectors & moral Pin
jmkhael5-Jul-02 3:53
jmkhael5-Jul-02 3:53 
GeneralRe: iterators & vectors & moral Pin
Christian Graus5-Jul-02 4:33
protectorChristian Graus5-Jul-02 4:33 
GeneralRe: iterators & vectors & moral Pin
Joaquín M López Muñoz5-Jul-02 5:42
Joaquín M López Muñoz5-Jul-02 5:42 
GeneralRe: iterators & vectors & moral Pin
Joaquín M López Muñoz5-Jul-02 4:34
Joaquín M López Muñoz5-Jul-02 4:34 
GeneralWriting permission bits to Access Database Pin
Hel4-Jul-02 22:25
Hel4-Jul-02 22:25 
GeneralPC Losing Time Pin
LittleYellowBird4-Jul-02 21:30
LittleYellowBird4-Jul-02 21:30 
GeneralRe: PC Losing Time Pin
Olli5-Jul-02 2:02
Olli5-Jul-02 2:02 
GeneralRe: PC Losing Time Pin
LittleYellowBird5-Jul-02 2:20
LittleYellowBird5-Jul-02 2:20 
GeneralRe: PC Losing Time Pin
Olli5-Jul-02 2:44
Olli5-Jul-02 2:44 
GeneralRe: PC Losing Time Pin
LittleYellowBird5-Jul-02 3:16
LittleYellowBird5-Jul-02 3:16 
GeneralRe: PC Losing Time Pin
Rutger Ellen5-Jul-02 3:34
Rutger Ellen5-Jul-02 3:34 
GeneralRe: PC Losing Time Pin
Venet5-Jul-02 4:17
Venet5-Jul-02 4:17 
GeneralRe: PC Losing Time Pin
Roger Wright5-Jul-02 4:38
professionalRoger Wright5-Jul-02 4:38 
QuestionCannot compile .h file? Pin
ivex4-Jul-02 20:56
ivex4-Jul-02 20:56 
AnswerRe: Cannot compile .h file? Pin
Christian Graus4-Jul-02 22:16
protectorChristian Graus4-Jul-02 22:16 
AnswerRe: Cannot compile .h file? Pin
Alexandru Savescu5-Jul-02 2:14
Alexandru Savescu5-Jul-02 2:14 
GeneralRegistering OCXs Pin
Jerome Conus4-Jul-02 20:16
Jerome Conus4-Jul-02 20:16 

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.