Click here to Skip to main content
15,914,322 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple question Pin
Stan Shannon16-Mar-02 2:27
Stan Shannon16-Mar-02 2:27 
GeneralRe: Simple question Pin
John Cruz16-Mar-02 2:29
John Cruz16-Mar-02 2:29 
GeneralRe: Simple question Pin
CDuddley16-Mar-02 13:24
CDuddley16-Mar-02 13:24 
GeneralRe: Simple question Pin
John Cruz16-Mar-02 14:51
John Cruz16-Mar-02 14:51 
GeneralFocus Pin
meirav15-Mar-02 23:36
meirav15-Mar-02 23:36 
GeneralRe: Focus Pin
Mazdak16-Mar-02 0:01
Mazdak16-Mar-02 0:01 
GeneralRe: Focus Pin
Nish Nishant16-Mar-02 1:02
sitebuilderNish Nishant16-Mar-02 1:02 
GeneralVC++ 6.0 string bug ? (take a look plz) Pin
Lockhart15-Mar-02 22:43
Lockhart15-Mar-02 22:43 
Here the SIMPLE project demo to illustrate the strange bug I noticed just some minutes ago. http://digilander.iol.it/ilbanca/fuffa/Bug.zip

Compile in Debug mode and press the button.
Compile in Release and press the button.

It beheaves in different ways (bad in Release)

The function that made me crazy:

[code]
void Buggy( char* result )
{
char s1[6];
char s2[5];

strcpy(s1,"abcde");
strcpy(s2,"BUG!");

// DOESNT WORK
strcpy(result,"anystring");
strcat(result,s1);

// THIS WAY WORKS
// strcpy(result,s1);
}
[/code]

In Debug mode works

In Release mode not
Setting 'Optimizations' to "Default" instead of "Maximixe Speed" solve the problem, but why?

I want to append 's1' to 'result', and it appends 's2' Cry | :(( ((((((((

Bye.
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Christian Graus15-Mar-02 22:53
protectorChristian Graus15-Mar-02 22:53 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart15-Mar-02 23:50
Lockhart15-Mar-02 23:50 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Christian Graus15-Mar-02 23:59
protectorChristian Graus15-Mar-02 23:59 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Neville Franks16-Mar-02 0:33
Neville Franks16-Mar-02 0:33 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 1:14
Lockhart16-Mar-02 1:14 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 1:03
Lockhart16-Mar-02 1:03 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Christian Graus16-Mar-02 1:06
protectorChristian Graus16-Mar-02 1:06 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 1:09
Lockhart16-Mar-02 1:09 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Nish Nishant16-Mar-02 1:05
sitebuilderNish Nishant16-Mar-02 1:05 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 1:06
Lockhart16-Mar-02 1:06 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Nish Nishant16-Mar-02 1:18
sitebuilderNish Nishant16-Mar-02 1:18 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 1:18
Lockhart16-Mar-02 1:18 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Nish Nishant16-Mar-02 3:26
sitebuilderNish Nishant16-Mar-02 3:26 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Neville Franks16-Mar-02 9:35
Neville Franks16-Mar-02 9:35 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 9:48
Lockhart16-Mar-02 9:48 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Neville Franks16-Mar-02 9:53
Neville Franks16-Mar-02 9:53 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 11:13
Lockhart16-Mar-02 11:13 

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.