Click here to Skip to main content
15,907,000 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Nooby would like to know how to make a button send Ctrl 1 Pin
David Crow26-Feb-08 17:07
David Crow26-Feb-08 17:07 
GeneralRe: Nooby would like to know how to make a button send Ctrl 1 Pin
Stephen Hewitt26-Feb-08 18:09
Stephen Hewitt26-Feb-08 18:09 
GeneralRe: Nooby would like to know how to make a button send Ctrl 1 Pin
ThatsAlok26-Feb-08 20:12
ThatsAlok26-Feb-08 20:12 
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 
Hello George,

Im not sure I understand your questions


<blockquote class="FQ"><div class="FQA">George_George wrote:</div>1. How do you deal with global object instance? There is no global stack or something, right?</blockquote>

There is only one stack, you can consider it a global stack I guess


<blockquote class="FQ"><div class="FQA">George_George wrote:</div>2. How do you pass one string object instance from one function to another -- safely to ensure address space is valid?</blockquote>

Its either passed by value in which case the assignment operator of the destination string is invoked, allocating memory if nessasary or its passed by reference in which case the underlying char array is not copied

Think of it like this

class string
{
public:
void assign(char* str)
{
if(strlen(str) &lt; 15)
{
//small string will fit in array on stack
strcpy(smallArray, str, strlen(str));
}
else
{
//to big for stack array so allocate space on heap
strPointer = new char[strlen(str)+1];
strcpy(strPointer, str, strlen(str));
}
}

private:
char smallArray[16];
char* strPointer;
};
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 
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 

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.