Seems to be in <iostream> but i have that referenced and am still getting a
384 `Replace' undeclared (first use this function)
Seems to be in <iostream> but i have that referenced and am still getting a
384 `Replace' undeclared (first use this function)
<algorithm>, if you're talking about 'replace' (not 'Replace').
there's also a replace function in <string>
I very highly recommend this resource: http://www.cppreference.com/index.html
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
Originally Posted by Rashakil Fol
Its Replace, does that mean it a custom function ?. Also, this probably a bit newb but my algorithm 'header' is just a file no extension ?
Argg...
I need a function that will replace a string with function in the form.
Replace(strString,".",",");
any ideas ?
I'm not sure, what is the value in strString, and what do you expect the output to be?
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
For example char strString = "hello,world"
Replace(strString,",",".")
would yield,
hello.world
So
replace(charater(s),find character(s),replace with)
.
that'd be the one in <algorithm>:output:Code:#include <iostream> #include <algorithm> #include <string> int main() { std::string s1="Hello,World"; std::cout<<"Original: "<<s1; replace(s1.begin(),s1.end(),',',' '); std::cout<<"\nNew: "<<s1<<std::endl; return 0; }Code:Original: Hello,World New: Hello World
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT