G
Guest
I am using Visual C++ .NET 2003. I have discovered the following problem and
did not find any other mention of it on the forums.
This code was being run in Debug mode, console application, with no changes
to the default project settings.
A basic overview of the problem is this: the two following sets of code
SHOULD compile and execute in the same way but they do NOT.
for (int i=0; i<256; i++)
if (table == *string) break;
for (int i=0; i<256; i++) {
if (table == *string) break;
}
Table is a static character array [256] and string is const char*.
In the first set of code, my program runs right over it, exiting with i = 0.
In the second set, it will exit with i = 116. You can download my exact
code from the following web address.
http://simsof.united.net.kg/BugCode.zip
did not find any other mention of it on the forums.
This code was being run in Debug mode, console application, with no changes
to the default project settings.
A basic overview of the problem is this: the two following sets of code
SHOULD compile and execute in the same way but they do NOT.
for (int i=0; i<256; i++)
if (table == *string) break;
for (int i=0; i<256; i++) {
if (table == *string) break;
}
Table is a static character array [256] and string is const char*.
In the first set of code, my program runs right over it, exiting with i = 0.
In the second set, it will exit with i = 116. You can download my exact
code from the following web address.
http://simsof.united.net.kg/BugCode.zip