Click here to Skip to main content
14,979,837 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Answerstd::map too slow Pin
bkelly1310-Nov-13 16:08
Memberbkelly1310-Nov-13 16:08 
GeneralRe: std::map too slow Pin
Albert Holguin14-Nov-13 10:02
professionalAlbert Holguin14-Nov-13 10:02 
GeneralRe: std::map too slow Pin
Aescleal15-Nov-13 11:07
MemberAescleal15-Nov-13 11:07 
GeneralRe: std::map too slow Pin
Albert Holguin15-Nov-13 11:32
professionalAlbert Holguin15-Nov-13 11:32 
QuestionWhy calling sort() crashes? Pin
Kumar Anitesh15-Oct-13 22:38
MemberKumar Anitesh15-Oct-13 22:38 
AnswerRe: Why calling sort() crashes? Pin
Richard MacCutchan15-Oct-13 23:06
mveRichard MacCutchan15-Oct-13 23:06 
AnswerRe: Why calling sort() crashes? Pin
Theo Buys9-Sep-14 2:46
MemberTheo Buys9-Sep-14 2:46 
Questionstd::string name.copy(...) Pin
bkelly132-Oct-13 12:02
Memberbkelly132-Oct-13 12:02 
Windows 7, Visual Studio 2008, C++, Console app
when writing an application that uses std::string this code does not compile:

void C_Client_WinAPI_TCP::Get_Host_Name( std::string * host_name )
{
    std::size_t source_length = host_name->length();
    std::size_t copy_length = m_host_name.copy( *host_name, source_length, 0 );


Getting the length is find. When doing the copy the error is:

1>e:\b\bryan_code\tcp_ip_win_api_01\client\c_client_winapi_tcp.cpp(22) : error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::copy' : cannot convert parameter 1 from 'std::string' to 'char *'

It seems to me that when using a std::string method, as in dot copy, it should copy from a std::string to another. Why not?

Edit: And given the above method declaration what is the right way to accomplish this concept:

m_C_Client_WinAPI_TCP.Get_Host_Name( "home" );
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/


modified 2-Oct-13 22:43pm.

AnswerRe: std::string name.copy(...) Pin
Richard MacCutchan2-Oct-13 21:24
mveRichard MacCutchan2-Oct-13 21:24 
GeneralRe: std::string name.copy(...) Pin
bkelly134-Oct-13 7:19
Memberbkelly134-Oct-13 7:19 
GeneralRe: std::string name.copy(...) Pin
Richard MacCutchan4-Oct-13 8:08
mveRichard MacCutchan4-Oct-13 8:08 
QuestionCreate iwebbrowser2 in protected mode Pin
narasingubhanu25-Sep-13 20:31
Membernarasingubhanu25-Sep-13 20:31 
AnswerRe: Create iwebbrowser2 in protected mode Pin
Richard MacCutchan25-Sep-13 21:31
mveRichard MacCutchan25-Sep-13 21:31 
GeneralRe: Create iwebbrowser2 in protected mode Pin
narasingubhanu26-Sep-13 0:23
Membernarasingubhanu26-Sep-13 0:23 
GeneralRe: Create iwebbrowser2 in protected mode Pin
Richard MacCutchan26-Sep-13 0:29
mveRichard MacCutchan26-Sep-13 0:29 
Questiononcreate function Pin
DongDong18-Sep-13 4:55
MemberDongDong18-Sep-13 4:55 
AnswerRe: oncreate function Pin
Richard MacCutchan8-Sep-13 6:54
mveRichard MacCutchan8-Sep-13 6:54 
QuestionGroup Box won't group Pin
bkelly1322-Aug-13 11:52
Memberbkelly1322-Aug-13 11:52 
AnswerRe: Group Box won't group Pin
Garth J Lancaster22-Aug-13 12:47
mveGarth J Lancaster22-Aug-13 12:47 
GeneralRe: Group Box won't group Pin
bkelly1322-Aug-13 12:55
Memberbkelly1322-Aug-13 12:55 
GeneralRe: Group Box won't group Pin
Garth J Lancaster24-Aug-13 16:14
mveGarth J Lancaster24-Aug-13 16:14 
AnswerRe: Group Box won't group Pin
yusif muffed ektilat25-Aug-13 9:15
professionalyusif muffed ektilat25-Aug-13 9:15 
GeneralRe: Group Box won't group Pin
bkelly1325-Aug-13 9:42
Memberbkelly1325-Aug-13 9:42 
AnswerRe: Group Box won't group Pin
pasztorpisti25-Aug-13 14:30
Memberpasztorpisti25-Aug-13 14:30 
AnswerRe: Group Box won't group Pin
H.Brydon19-Sep-13 20:39
professionalH.Brydon19-Sep-13 20:39 

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.