Click here to Skip to main content
15,917,320 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: mciSendString - AVI file with strange colours Pin
26-Apr-02 15:47
suss26-Apr-02 15:47 
GeneralRe: mciSendString - AVI file with strange colours Pin
Tom Archer26-Apr-02 15:51
Tom Archer26-Apr-02 15:51 
GeneralDebug Output Window Pin
RaviJoshi26-Apr-02 12:51
RaviJoshi26-Apr-02 12:51 
GeneralRe: Debug Output Window Pin
Michael P Butler27-Apr-02 10:46
Michael P Butler27-Apr-02 10:46 
QuestionDisplay a graph / Extend CListView? Pin
26-Apr-02 12:21
suss26-Apr-02 12:21 
QuestionHow to place and drive activex controls in CView Pin
HallerbachJ26-Apr-02 10:33
HallerbachJ26-Apr-02 10:33 
Generalstack corrupted Pin
Steve Severance26-Apr-02 8:26
Steve Severance26-Apr-02 8:26 
GeneralRe: stack corrupted Pin
Paul M Watt26-Apr-02 8:39
mentorPaul M Watt26-Apr-02 8:39 
With this piece of code:
char strReturn[] = "O";

you are only allocating one byte of memory for your string. The reason why you are getting the stack corrupt error is because you have the parameters backwards in your strcat function. I think that this is what you meant to do:
if(isupper(Position[0]))
{
  char strReturn[] = "O";
  strcat(word, strReturn);
}
else
{
  char strReturn[] = "o";
  strcat(word, strReturn);
}

The string that you want to append the data to goes in the first parameter of strcat. Also the value that is returned is the same pointer that is in word.

One more thing, you do not have to allocate a buffer for strReturn, you can simply do this:
strcat(word, "o");


Good Luck!


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: stack corrupted Pin
Steve Severance26-Apr-02 11:11
Steve Severance26-Apr-02 11:11 
GeneralRe: stack corrupted Pin
Paul M Watt26-Apr-02 15:46
mentorPaul M Watt26-Apr-02 15:46 
GeneralRe: stack corrupted Pin
Steve Severance28-Apr-02 7:30
Steve Severance28-Apr-02 7:30 
QuestionPointer in a .txt file? Pin
26-Apr-02 7:56
suss26-Apr-02 7:56 
AnswerRe: Pointer in a .txt file? Pin
Albert Pascual26-Apr-02 8:55
sitebuilderAlbert Pascual26-Apr-02 8:55 
AnswerRe: Pointer in a .txt file? Pin
wangyiming26-Apr-02 22:15
wangyiming26-Apr-02 22:15 
QuestionAn memory management problem ? Pin
yarp26-Apr-02 7:13
yarp26-Apr-02 7:13 
AnswerRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 7:42
mentorPaul M Watt26-Apr-02 7:42 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 8:06
yarp26-Apr-02 8:06 
GeneralRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 8:12
mentorPaul M Watt26-Apr-02 8:12 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 8:18
yarp26-Apr-02 8:18 
GeneralRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 8:32
mentorPaul M Watt26-Apr-02 8:32 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 9:04
Tim Smith26-Apr-02 9:04 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 9:27
yarp26-Apr-02 9:27 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 10:00
Tim Smith26-Apr-02 10:00 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 10:27
yarp26-Apr-02 10:27 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 12:14
yarp26-Apr-02 12:14 

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.