Click here to Skip to main content
16,011,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Nooby would like to know how to make a button send Ctrl 1 Pin
doorprize2-Mar-08 17:46
doorprize2-Mar-08 17:46 
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 
Thanks Josh,


I find the warning of your code in Visual Studio 2008,

warning C4172: returning address of local variable or temporary

But what makes me confused is, as you mentioned if the content is larger than 16 bytes, heap should be used to allocate, right?

But why if I increase the length of thecontent, the same warning exists? My code,

#include <string>

using namespace std;

string& goo()
{
	string myString("George is cool 111111111111111111111 11111111111111111111111111111111111");
	return myString;
}

void foo()
{
	string& str = goo();
}



regards,
George
GeneralRe: space in string Pin
User 58385226-Feb-08 16:56
User 58385226-Feb-08 16:56 
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 

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.