| |||||
Technical Support Support Resources
Product Information | C166: #IFDEF CAUSING STRING TEST PROBLEMSInformation in this article applies to:
QUESTIONI have written the following code:
#include <string.h>
#define SPECIAL
int x = 0;
char label[10];
void foo(void) { x = 1; }
void main(void)
{
#ifdef SPECIAL
if (!*label) strcpy(label,"Online");
#endif
if (*label) foo();
while(1);
}
The function foo() should be called when SPECIAL is defined as the string label is no longer null. However, the function is not called. If I assign "Online" to the string label at declaration time, the function foo() is called. Is there a fix for this? ANSWERThis was a problem in C166 V4.04 and earlier. It was corrected in C166 Version 4.05. You may download the latest updates from the Keil Website. Last Reviewed: Tuesday, June 15, 2004 | ||||
| |||||