Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: modeless dialog box Pin
KarstenK30-Nov-07 1:48
mveKarstenK30-Nov-07 1:48 
QuestionRe: modeless dialog box Pin
Nelek30-Nov-07 1:49
protectorNelek30-Nov-07 1:49 
AnswerRe: modeless dialog box Pin
JudyL_MD30-Nov-07 2:25
JudyL_MD30-Nov-07 2:25 
QuestionRe: modeless dialog box Pin
David Crow30-Nov-07 3:22
David Crow30-Nov-07 3:22 
QuestionProblem with EXIF Format to BMP Pin
KANAKESH30-Nov-07 0:17
KANAKESH30-Nov-07 0:17 
AnswerRe: Problem with EXIF Format to BMP Pin
Paresh Chitte30-Nov-07 1:16
Paresh Chitte30-Nov-07 1:16 
AnswerRe: Problem with EXIF Format to BMP Pin
Mark Salsbery30-Nov-07 10:03
Mark Salsbery30-Nov-07 10:03 
QuestionLooping through a string Pin
admgamer29-Nov-07 23:29
admgamer29-Nov-07 23:29 
Hi,

Im trying to loop through a string to get all layout of words in a forward manner and then search for patterns elsewhere.

I first created this:

spacePos.push_back(0);
for(int j = 0; j<input.length()+1; j++)
="" {
="" if="" (input[j]="=" char(32)="" ||="" j="=" input.length()){
="" spacepos.push_back(j);
="" }
="" }

basically="" pushes="" integers="" onto="" a="" vector="" of="" ints,="" with="" the="" start="" and="" end="" position,="" also="" where="" any="" spaces="" are.

then="" i="" try="" ot="" loop="" as="" so:

="" for(vector<int="">::iterator ii = spacePos.begin(); ii!=spacePos.end(); ii++)
{
for(vector<int>::iterator ii2 = spacePos.begin(); ii2!=spacePos.end(); ii2++)
{
if (*ii2 == 0 || *ii >= *ii2) continue;

if (input.substr(*ii, *ii2) != "")
{
//other code
}
}
}

so if the input line was "hello i am" it would 'hopefuly' do this>

"hello"
"hello i"
"hello i am"
"i"
"i am"
etc

but the problem is, i'm counting the spaces in the first for loop and storing them and after the first iterator of the for loop for ii, it's going out of sync and the longer the string the more this affect occurs:

"hello"
"hello i"
"hello i am"
" i"
" i am"

i tried trimming but it just causes so many problems with long strings so i really want to sort this out in the first for loop where i obtain all the space positions.

Does anyone have any ideas? or maybe even a better way to do what i want?

Cheers
QuestionRe: Looping through a string Pin
David Crow30-Nov-07 3:26
David Crow30-Nov-07 3:26 
Questioncompile code in without unicode Pin
Kiran Pinjala29-Nov-07 23:08
Kiran Pinjala29-Nov-07 23:08 
AnswerRe: compile code in without unicode Pin
uusheikh29-Nov-07 23:14
uusheikh29-Nov-07 23:14 
GeneralRe: compile code in without unicode Pin
Kiran Pinjala29-Nov-07 23:16
Kiran Pinjala29-Nov-07 23:16 
QuestionRe: compile code in without unicode Pin
Kiran Pinjala29-Nov-07 23:25
Kiran Pinjala29-Nov-07 23:25 
AnswerRe: compile code in without unicode Pin
David Crow30-Nov-07 3:29
David Crow30-Nov-07 3:29 
AnswerRe: compile code in without unicode Pin
CPallini29-Nov-07 23:22
mveCPallini29-Nov-07 23:22 
AnswerRe: compile code in without unicode Pin
Mike Dimmick30-Nov-07 0:36
Mike Dimmick30-Nov-07 0:36 
QuestionHow to make aspect ratio independent graphics? Pin
rkshdixit29-Nov-07 22:42
rkshdixit29-Nov-07 22:42 
AnswerRe: How to make aspect ratio independent graphics? Pin
Nelek30-Nov-07 0:03
protectorNelek30-Nov-07 0:03 
Questioncreate save dialog box. Pin
keyto29-Nov-07 22:38
keyto29-Nov-07 22:38 
AnswerRe: create save dialog box. Pin
Hamid_RT29-Nov-07 22:56
Hamid_RT29-Nov-07 22:56 
AnswerRe: create save dialog box. Pin
JudyL_MD30-Nov-07 2:29
JudyL_MD30-Nov-07 2:29 
QuestionSQLBindParameter not working Pin
prithaa29-Nov-07 22:37
prithaa29-Nov-07 22:37 
AnswerRe: SQLBindParameter not working Pin
JudyL_MD30-Nov-07 2:30
JudyL_MD30-Nov-07 2:30 
QuestionSQLBindParameter problem Pin
prithaa29-Nov-07 22:21
prithaa29-Nov-07 22:21 
AnswerRe: SQLBindParameter problem Pin
David Crow30-Nov-07 3:32
David Crow30-Nov-07 3: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.