Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: executable still running in back evenafter file exit Pin
14-May-02 19:40
suss14-May-02 19:40 
GeneralWho can help me to receive letter :) Pin
Cliff14-May-02 17:22
Cliff14-May-02 17:22 
GeneralRe: Who can help me to receive letter :) Pin
Nish Nishant14-May-02 17:31
sitebuilderNish Nishant14-May-02 17:31 
GeneralRe: Who can help me to receive letter :) Pin
Ravi Bhavnani14-May-02 17:26
professionalRavi Bhavnani14-May-02 17:26 
GeneralRe: Who can help me to receive letter :) Pin
Cliff15-May-02 16:04
Cliff15-May-02 16:04 
QuestionMultithread ? Pin
dlhson14-May-02 16:50
dlhson14-May-02 16:50 
AnswerRe: Multithread ? Pin
Nish Nishant14-May-02 17:20
sitebuilderNish Nishant14-May-02 17:20 
AnswerRe: Multithread ? Pin
Larry Antram14-May-02 19:32
Larry Antram14-May-02 19:32 
GeneralCStdioFile Question... Pin
Emearg14-May-02 15:54
Emearg14-May-02 15:54 
GeneralRe: CStdioFile Question... Pin
Jason Henderson14-May-02 16:41
Jason Henderson14-May-02 16:41 
GeneralRe: CStdioFile Question... Pin
Emearg14-May-02 16:58
Emearg14-May-02 16:58 
GeneralRe: CStdioFile Question... Pin
Nish Nishant14-May-02 17:17
sitebuilderNish Nishant14-May-02 17:17 
GeneralRe: CStdioFile Question... Pin
Emearg14-May-02 18:05
Emearg14-May-02 18:05 
GeneralA good tool for programmer Pin
14-May-02 15:35
suss14-May-02 15:35 
GeneralCreating UI with Threads Pin
Coremn14-May-02 15:23
Coremn14-May-02 15:23 
GeneralRe: Creating UI with Threads Pin
Tim Smith14-May-02 15:35
Tim Smith14-May-02 15:35 
GeneralRe: Creating UI with Threads Pin
Coremn14-May-02 15:48
Coremn14-May-02 15:48 
GeneralRe: Creating UI with Threads Pin
Jon Hulatt15-May-02 0:07
Jon Hulatt15-May-02 0:07 
GeneralUnhandled exception... Pin
SilverShalkin14-May-02 14:49
SilverShalkin14-May-02 14:49 
ok... I've had problems with unhandled exception error before... but right when i fixed it, i kind of forgot what i did to fix it... this is my code... "im posting it all.. except my header file, just to make sure you know what im doing."

#include <iostream>
#include "Class.h"//included header "Class.h"

using namespace std;

Name person; //class def person

int NN = 1;//incriment
char Names[21]; //total amount of names

char SName[100];

//SetName function.
bool Name::SetName(char* NName)
{

if(!NName)
{
return false;
}

int NLen = (strlen(NName) + 1);
char *NewName = new char[NLen];

if(!NewName)
{
return false;
}

strcpy(NewName, NName);
delete[] M_Name;
M_Name = NewName;

Names[NN] = *M_Name;//I think it has somthing to do with this
NN++;

return true;
}

const char* Name::GetName()
{
return M_Name;
}


//main
int main()
{
for(;;)//main loop
{
gets(SName);
person.SetName(SName);
cout << person.GetName() << endl << endl; //print name that you just typed.

for(int inc;inc < NN;inc++) //print all names.
{
cout << Names[inc] << endl; //error unhandled exception.
}//end of print all names, loop.

inc = 1;
}//end main loop.

return 0;
}
//end main




//constructor & deconstructor
//*******************
Name::Name()
{
M_Name = NULL;
}

Name::~Name()
{
delete[] M_Name;
}

The error accured when i tried to set Names[NN] = *M_Name; the error feels like its at the tip of my tongue, yet i cant think of it.

Thanks all for the help!

~SilverShalkin

ps... how do you show a screen shot of your code? or post your code on CP with its background different... "is ther a place on the forum that shows how?"
Thanks!

Rose | [Rose]
GeneralRe: Unhandled exception... Pin
soptest14-May-02 15:00
soptest14-May-02 15:00 
GeneralRe: Unhandled exception... Pin
Christian Graus14-May-02 15:08
protectorChristian Graus14-May-02 15:08 
GeneralRe: Unhandled exception... Pin
Christian Graus14-May-02 15:06
protectorChristian Graus14-May-02 15:06 
GeneralRe: Unhandled exception... Pin
SilverShalkin14-May-02 17:04
SilverShalkin14-May-02 17:04 
GeneralRe: Unhandled exception... Pin
Christian Graus14-May-02 17:36
protectorChristian Graus14-May-02 17:36 
GeneralRe: Unhandled exception... Pin
SilverShalkin14-May-02 18:01
SilverShalkin14-May-02 18:01 

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.