Re: xutility iterator_category build errors
- From: "Carl R. Davies" <nwsgrp1@xxxxxxxxxxxxxx>
- Date: Thu, 22 Mar 2007 23:18:52 +0000
Carl R. Davies wrote:
Apologies for cross posting between m.p.vc.lang and m.p.vc.stl not sure which newsgroup is appropriate.[snip]
I'm using VS 2005 and have the following code:
#include <string>
#include <algorithm>
#include <iostream>
int main()
{
std::string url = "http:\\\\test.com\\index.htm";
std::string oldVal = "\\", newVal = "/";
std::string newUrl;
std::replace_copy( url.begin(),
url.end(),
newUrl,
oldVal,
newVal );
std::cout << newUrl << std::endl;
return EXIT_SUCCESS;
}
Which produces the following errors:
> Thank you for your time.
> Carl.
Think I've fixed it:
#include <string>
#include <algorithm>
#include <iostream>
int main()
{
std::string url = "http:\\\\test.com\\index.htm";
std::string newUrl;
std::replace_copy( url.begin(),
url.end(),
back_inserter(newUrl),
'\\',
'/' );
std::cout << newUrl << std::endl;
return EXIT_SUCCESS;
}
Any other beginner bugs :) ?
.
- References:
- xutility iterator_category build errors
- From: Carl R. Davies
- xutility iterator_category build errors
- Prev by Date: xutility iterator_category build errors
- Next by Date: Re: xutility iterator_category build errors
- Previous by thread: xutility iterator_category build errors
- Next by thread: Re: xutility iterator_category build errors
- Index(es):
Loading