Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

C++






Daedal

0
Joined
May 23, 2007
Messages
2,277
Points
0
Have you tried using size_type variables instead of int? I know that it may cause problems sometimes depending on the compiler...

std::string temp = b;
std::string::size_type index = temp.find("hello",0);

while(index != std::string::npos)
{
temp.replace(index, 5, "hi", 2);
index = temp.find("hello",index);
}

GL;
DDL
 

Daedal

0
Joined
May 23, 2007
Messages
2,277
Points
0
It's funny how I do most of my code thinking while away from the computer... ;D

I go away and start thinking in code... then come back with a little fix I had ignored somewhere...

--DDL
 
Joined
Oct 23, 2007
Messages
1,904
Points
0
OK, I used your suggestion DDL, it doesn't crash now but for some reason the data gets messed up...
 
Joined
Dec 9, 2007
Messages
35
Points
0
i do C++. haven't done it in a while. Not that good in it either. Haven't needed it enough to learn a lot.
 




Top