Click here to Skip to main content
15,896,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Header file Pin
CPallini8-Apr-09 22:42
mveCPallini8-Apr-09 22:42 
AnswerRe: Header file Pin
Hamid_RT8-Apr-09 23:52
Hamid_RT8-Apr-09 23:52 
QuestionShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Le@rner8-Apr-09 21:03
Le@rner8-Apr-09 21:03 
AnswerRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Rajesh R Subramanian8-Apr-09 21:37
professionalRajesh R Subramanian8-Apr-09 21:37 
JokeRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
CPallini8-Apr-09 22:01
mveCPallini8-Apr-09 22:01 
JokeRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Rajesh R Subramanian8-Apr-09 22:20
professionalRajesh R Subramanian8-Apr-09 22:20 
AnswerRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Hamid_RT8-Apr-09 23:56
Hamid_RT8-Apr-09 23:56 
QuestionBasic Segmentation fault help needed Pin
Brandon Ramirez8-Apr-09 20:56
Brandon Ramirez8-Apr-09 20:56 
i wrote the code below for a C++ programming class and i get a segmentation fault within this part of the code. now i asked my teacher and he told me that there's just a line in the wrong place but for the life of me i can't figure out which line is out of place. i thought i'd turn to some people with more experience with looking at code and finding the errors. it's really a simple problem i have i'm just not seeing it though.. please help me!


p.s. sorry if i posted the code the wrong way for the forum
void Search::Store(char *k, char *d) {

struct TBox *p1,*p2;
int i;

p1 = new TBox;

if (Start==NULL) {

p1->left = NULL;
p1->right = NULL;
p1->key = new char[strlen(k)+1];
p1->data = new char[strlen(d)+1];
strcpy(p1->key,k);
strcpy(p1->data,d);
Start=p1;

return;

p1=Start;

while(p1!=NULL) {

if ( (i=strcmp(k,p1->key)) == 0 ) {
delete [] p1->data;
p1->data = new char[strlen(d)+1];
strcpy(p1->data,d);
return;
}

if ( i < 0 ) {
p2=p1;

p1=p1->left;
continue;
}
p2=p1;
p1=p1->right;
}

}

p1 = new TBox;

p1->left = NULL;
p1->right = NULL;
p1->key = new char[strlen(k)+1];
p1->data = new char[strlen(d)+1];
strcpy(p1->key,k);
strcpy(p1->data,d);
Start=p1;


if (i<0) p2->left=p1;
else p2->right=p1;

return;


}

QuestionRe: Basic Segmentation fault help needed Pin
CPallini8-Apr-09 21:27
mveCPallini8-Apr-09 21:27 
QuestionRe: Basic Segmentation fault help needed Pin
Brandon Ramirez8-Apr-09 21:46
Brandon Ramirez8-Apr-09 21:46 
AnswerRe: Basic Segmentation fault help needed Pin
CPallini8-Apr-09 21:58
mveCPallini8-Apr-09 21:58 
GeneralRe: Basic Segmentation fault help needed Pin
Brandon Ramirez8-Apr-09 22:11
Brandon Ramirez8-Apr-09 22:11 
GeneralRe: Basic Segmentation fault help needed Pin
CPallini8-Apr-09 22:22
mveCPallini8-Apr-09 22:22 
AnswerRe: Basic Segmentation fault help needed Pin
Stuart Dootson8-Apr-09 23:13
professionalStuart Dootson8-Apr-09 23:13 
GeneralRe: Basic Segmentation fault help needed Pin
CPallini8-Apr-09 23:24
mveCPallini8-Apr-09 23:24 
QuestionRe: Basic Segmentation fault help needed Pin
David Crow9-Apr-09 3:19
David Crow9-Apr-09 3:19 
Questionpointer on class Pin
durban28-Apr-09 20:34
durban28-Apr-09 20:34 
AnswerRe: pointer on class Pin
«_Superman_»8-Apr-09 20:37
professional«_Superman_»8-Apr-09 20:37 
AnswerRe: pointer on class Pin
Paresh Chitte8-Apr-09 21:04
Paresh Chitte8-Apr-09 21:04 
AnswerRe: pointer on class Pin
KarstenK8-Apr-09 21:17
mveKarstenK8-Apr-09 21:17 
GeneralRe: pointer on class Pin
durban29-Apr-09 21:34
durban29-Apr-09 21:34 
GeneralRe: pointer on class Pin
KarstenK13-Apr-09 22:07
mveKarstenK13-Apr-09 22:07 
GeneralRe: pointer on class Pin
ThatsAlok8-Apr-09 22:59
ThatsAlok8-Apr-09 22:59 
QuestionRun an exe from ShellExecute with administrator permission in Vista. Pin
Le@rner8-Apr-09 19:59
Le@rner8-Apr-09 19:59 
JokeRe: Run an exe from ShellExecute with administrator permission in Vista. Pin
«_Superman_»8-Apr-09 20:02
professional«_Superman_»8-Apr-09 20:02 

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.