Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ alphabitizing

Name: Anonymous 2007-11-19 2:00

C++


for (int k = 0; k < 10; k++)
{ if(boyName[fileCount][babyCount].at(k)> boyName[fileCount][babyCount+1].at(k))
{
temp = boyName[fileCount][babyCount];
boyName[fileCount][babyCount] = boyName[fileCount][babyCount+1];
boyName[fileCount][babyCount+1] = temp;

}
}

someone tell me why this bit of code won't work?
i'm comparing strings and alphabetizing them (about 10000 stored in an array)
if k is initialized to 0 and it's not a for loop it'll run fine, and alphabetize it but only by the first letter.

Name: Anonymous 2007-11-19 3:36

>>1
Shit are you daft? Either use std::fucking::sort in <algorithm>, or use a goddamn set to store your fucking data. Seriously, what the fucking hell. It's not like your shitcanned sort "algorithm" (LOL SWITCH SORT) provides any performance gains.

Just shitcan what you have and use a real method of doing it. Fucking goddamn faggots, C++ IS NOT C.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List