See the attached code sample.
In the function "clear_string" I can't watch the value of the string "text" when I switch off optimization.
Flags are: -Tx86-coff -Zi -Ob1 -fp:precise -W1 -Gd
I'm always in doubt what optimization I should use for debugging purposes... I thought all variables should be visible with optimization turned off.
#include <string.h>
#include <stdio.h>
void clear_string(char * text)
{
strcpy(text,"");
printf("string cleared!\n");
}
int main(void)
{
char text[100];
strcpy(text,"This is a test");
printf("old string: %s\n",text);
clear_string(text);
printf("new string: %s\n",text);
return(0);
}