Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerSolution found but still buggy. Pin
C_Zealot26-May-07 0:28
C_Zealot26-May-07 0:28 
GeneralRe: Solution found but still buggy. Pin
Taka Muraoka26-May-07 1:11
Taka Muraoka26-May-07 1:11 
GeneralRe: Solution found but still buggy. Pin
C_Zealot26-May-07 1:15
C_Zealot26-May-07 1:15 
Questionpls help me Pin
deeps_cute25-May-07 22:18
deeps_cute25-May-07 22:18 
AnswerRe: pls help me Pin
Hans Dietrich26-May-07 15:01
mentorHans Dietrich26-May-07 15:01 
AnswerRe: pls help me Pin
Michael Dunn26-May-07 20:49
sitebuilderMichael Dunn26-May-07 20:49 
Question860305 - Alt+Tab in Emulator Pin
ilostmyid225-May-07 21:18
professionalilostmyid225-May-07 21:18 
QuestionProblem with pointer Pin
zeus200025-May-07 18:58
zeus200025-May-07 18:58 
Hi,

I have a big problem with the following code:

int _tmain(int argc, _TCHAR* argv[])
{
class2 *c2 = new class2();
class1 *c1 = new class1();
c1->doit(c2);

return 0;
}

class2::class2(void)
{
hold = new char*[2];
hold[0] = new char[10];
hold[1] = new char[10];
hold[0] = "test";
hold[1] = "me";
}
void class2::get(int index, char *result)
{
result = hold[index];
return;
}

class1::class1(void)
{
}
void class1::doit(class2 *c2)
{

c2->get(0, pszTmp);
c2->get(1, pszTmp);

return;
}

The Problem is that pszTmp never points to the arrays contents of the array hold.
When I run the code in the debugger it always stays a <bad pointer="">.
Does anyone know what I am making wrong?

P.S.: I am using Visual Studio 2005
AnswerRe: Problem with pointer Pin
Michael Dunn25-May-07 21:26
sitebuilderMichael Dunn25-May-07 21:26 
AnswerRe: Problem with pointer Pin
CPallini25-May-07 22:15
mveCPallini25-May-07 22:15 
AnswerRe: Problem with pointer Pin
zeus200027-May-07 0:02
zeus200027-May-07 0:02 
GeneralRe: Problem with pointer Pin
Niklas L28-May-07 0:26
Niklas L28-May-07 0:26 
QuestionQuestion regarding Directshow and custom video capture Pin
godspeed12325-May-07 15:32
godspeed12325-May-07 15:32 
AnswerRe: Question regarding Directshow and custom video capture Pin
Mark Salsbery26-May-07 6:33
Mark Salsbery26-May-07 6:33 
QuestionAfxMessageBox stop working after split the frame Pin
gurucplusplus25-May-07 14:01
gurucplusplus25-May-07 14:01 
AnswerRe: AfxMessageBox stop working after split the frame Pin
Demian Panello25-May-07 15:31
Demian Panello25-May-07 15:31 
GeneralRe: AfxMessageBox stop working after split the frame Pin
gurucplusplus25-May-07 16:52
gurucplusplus25-May-07 16:52 
GeneralRe: AfxMessageBox stop working after split the frame Pin
Demian Panello26-May-07 3:41
Demian Panello26-May-07 3:41 
GeneralRe: AfxMessageBox stop working after split the frame Pin
gurucplusplus26-May-07 6:58
gurucplusplus26-May-07 6:58 
GeneralRe: AfxMessageBox stop working after split the frame Pin
Demian Panello26-May-07 14:34
Demian Panello26-May-07 14:34 
GeneralRe: AfxMessageBox stop working after split the frame Pin
gurucplusplus27-May-07 20:03
gurucplusplus27-May-07 20:03 
QuestionGetting handle of folders with CreateFile Pin
Akin Ocal25-May-07 11:46
Akin Ocal25-May-07 11:46 
AnswerRe: Getting handle of folders with CreateFile Pin
Mark Salsbery25-May-07 11:57
Mark Salsbery25-May-07 11:57 
QuestionHow to enum access permissions and SIDs Pin
Akin Ocal25-May-07 11:45
Akin Ocal25-May-07 11:45 
AnswerRe: How to enum access permissions and SIDs Pin
Hans Dietrich26-May-07 15:30
mentorHans Dietrich26-May-07 15:30 

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.