Click here to Skip to main content
15,890,946 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CreateRemoteThread Error Pin
elchupathingy12-Aug-10 4:56
elchupathingy12-Aug-10 4:56 
GeneralRe: CreateRemoteThread Error Pin
gothic_coder12-Aug-10 21:15
gothic_coder12-Aug-10 21:15 
QuestionDuplicate String Pin
T.RATHA KRISHNAN11-Aug-10 23:08
T.RATHA KRISHNAN11-Aug-10 23:08 
QuestionRe: Duplicate String Pin
CPallini11-Aug-10 23:48
mveCPallini11-Aug-10 23:48 
AnswerRe: Duplicate String Pin
T.RATHA KRISHNAN11-Aug-10 23:59
T.RATHA KRISHNAN11-Aug-10 23:59 
AnswerRe: Duplicate String Pin
Nuri Ismail12-Aug-10 0:01
Nuri Ismail12-Aug-10 0:01 
GeneralRe: Duplicate String Pin
T.RATHA KRISHNAN12-Aug-10 0:12
T.RATHA KRISHNAN12-Aug-10 0:12 
GeneralRe: Duplicate String Pin
Nuri Ismail12-Aug-10 0:37
Nuri Ismail12-Aug-10 0:37 
I pointed out one of the problems with your for loop.
Also see the post[^] from Ash for the other problems.

You should really replace this loop with something normal like:
// Call srand only once, no need for additional calls
srand(time(0));
const int total_players = players.size();
// Do not use register it's not a good idea, believe me! :)
for(int i = 0; i < total_players; ++i)
{
   // No need to increment i here
   nameSecondPart.push_back(swapChars(players[i]));
}


Try with the loop above and see what happens. Also use your debugger, it is your friend! Smile | :)
And about your hand-crafted swapChars function, why not use std::transform?

Smile | :)
GeneralRe: Duplicate String Pin
Aescleal12-Aug-10 0:14
Aescleal12-Aug-10 0:14 
GeneralRe: Duplicate String Pin
T.RATHA KRISHNAN12-Aug-10 0:32
T.RATHA KRISHNAN12-Aug-10 0:32 
GeneralRe: Duplicate String Pin
CPallini12-Aug-10 0:46
mveCPallini12-Aug-10 0:46 
GeneralRe: Duplicate String Pin
Aescleal12-Aug-10 1:18
Aescleal12-Aug-10 1:18 
GeneralRe: Duplicate String Pin
CPallini12-Aug-10 1:36
mveCPallini12-Aug-10 1:36 
GeneralRe: Duplicate String Pin
Aescleal12-Aug-10 2:17
Aescleal12-Aug-10 2:17 
GeneralRe: Duplicate String Pin
Nuri Ismail12-Aug-10 0:44
Nuri Ismail12-Aug-10 0:44 
GeneralRe: Duplicate String Pin
Niklas L12-Aug-10 1:17
Niklas L12-Aug-10 1:17 
GeneralRe: Duplicate String Pin
Aescleal12-Aug-10 1:19
Aescleal12-Aug-10 1:19 
GeneralRe: Duplicate String Pin
Niklas L12-Aug-10 1:30
Niklas L12-Aug-10 1:30 
GeneralRe: Duplicate String Pin
CPallini12-Aug-10 1:38
mveCPallini12-Aug-10 1:38 
GeneralRe: Duplicate String Pin
Niklas L12-Aug-10 1:42
Niklas L12-Aug-10 1:42 
GeneralRe: Duplicate String Pin
CPallini12-Aug-10 1:59
mveCPallini12-Aug-10 1:59 
GeneralRe: Duplicate String Pin
Niklas L12-Aug-10 5:34
Niklas L12-Aug-10 5:34 
QuestionC++ Pin
tushar.shinde00711-Aug-10 21:29
tushar.shinde00711-Aug-10 21:29 
AnswerRe: C++ PinPopular
Rick York11-Aug-10 21:39
mveRick York11-Aug-10 21:39 
QuestionLNK2001 - Help needed Pin
Hari_1611-Aug-10 20:07
Hari_1611-Aug-10 20:07 

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.