Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalspace in string Pin
George_George26-Feb-08 15:23
George_George26-Feb-08 15:23 
GeneralRe: space in string Pin
User 58385226-Feb-08 15:49
User 58385226-Feb-08 15:49 
GeneralRe: space in string Pin
George_George26-Feb-08 16:01
George_George26-Feb-08 16:01 
GeneralRe: space in string Pin
User 58385226-Feb-08 16:11
User 58385226-Feb-08 16:11 
GeneralRe: space in string Pin
George_George26-Feb-08 16:26
George_George26-Feb-08 16:26 
GeneralRe: space in string Pin
User 58385226-Feb-08 16:39
User 58385226-Feb-08 16:39 
GeneralRe: space in string Pin
George_George26-Feb-08 16:46
George_George26-Feb-08 16:46 
GeneralRe: space in string Pin
User 58385226-Feb-08 16:56
User 58385226-Feb-08 16:56 
You get the warning because myString is on the stack. If it is internally using the heao to store something it doesnt matter. When the method returns myString is lost and with it the pointer to the memory on the heap

You could try

void foo()
{
string myString;

goo(myString);
}

void goo(string& str)
{
str = "George is cool";
}
GeneralRe: space in string Pin
George_George26-Feb-08 17:31
George_George26-Feb-08 17:31 
GeneralRe: space in string Pin
David Crow26-Feb-08 17:16
David Crow26-Feb-08 17:16 
GeneralRe: space in string Pin
George_George26-Feb-08 17:32
George_George26-Feb-08 17:32 
Generalsilently installing .reg file Pin
act_x26-Feb-08 10:58
act_x26-Feb-08 10:58 
GeneralRe: silently installing .reg file Pin
Dave Calkins26-Feb-08 16:16
Dave Calkins26-Feb-08 16:16 
GeneralRe: silently installing .reg file Pin
ThatsAlok27-Feb-08 16:10
ThatsAlok27-Feb-08 16:10 
QuestionIs this book on the standard library worth it? Pin
markt26-Feb-08 5:53
markt26-Feb-08 5:53 
AnswerRe: Is this book on the standard library worth it? Pin
Dave Calkins26-Feb-08 6:17
Dave Calkins26-Feb-08 6:17 
AnswerRe: Is this book on the standard library worth it? Pin
Nemanja Trifunovic26-Feb-08 7:21
Nemanja Trifunovic26-Feb-08 7:21 
GeneralRe: Is this book on the standard library worth it? Pin
markt26-Feb-08 11:29
markt26-Feb-08 11:29 
GeneralRe: Is this book on the standard library worth it? Pin
User 58385226-Feb-08 15:50
User 58385226-Feb-08 15:50 
GeneralProblems receiving highspeed data using CAsyncSocket::OnReceive() Pin
97C5ENVY26-Feb-08 4:51
97C5ENVY26-Feb-08 4:51 
GeneralRe: Problems receiving highspeed data using CAsyncSocket::OnReceive() Pin
Mark Salsbery26-Feb-08 5:23
Mark Salsbery26-Feb-08 5:23 
GeneralRe: Problems receiving highspeed data using CAsyncSocket::OnReceive() Pin
97C5ENVY26-Feb-08 7:27
97C5ENVY26-Feb-08 7:27 
GeneralRe: Problems receiving highspeed data using CAsyncSocket::OnReceive() Pin
led mike26-Feb-08 7:33
led mike26-Feb-08 7:33 
GeneralRe: Problems receiving highspeed data using CAsyncSocket::OnReceive() Pin
Mark Salsbery26-Feb-08 8:12
Mark Salsbery26-Feb-08 8:12 
GeneralRe: Problems receiving highspeed data using CAsyncSocket::OnReceive() Pin
97C5ENVY26-Feb-08 8:45
97C5ENVY26-Feb-08 8:45 

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.