We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Here's an excerpt of my main module (the beginning of it): #include <ezusb.h> #include <ezregs.h> #include <tng.h> #include <string.h> #include "system.h" #include "lcd.h" #define IMG_SIZE (21*16) extern BYTE xdata DataBuf[]; volatile BYTE Display_Mode, LineCount, X_Offset, Row_Start = 0, GrabRequest, GrabOn, H_Bytes, Zoom_Value; DWORD j; BYTE i; WORD ill1=1500, ill2=1500; static xdata WORD k = 300; void ShowPicture(void) { ... ordinary functions and code I accidentally put a semicolon after "Row_Start = 0" when splitting the line for new variables. The module compiled fine, resulting to weird behavior. So, what exactly does the compiler do when encountering plain variable names on a line? I'm using KEIL V5.20 (DLL 1.32a). Thanks, Harri
C allows the type specifier to be omitted, in which case it defaults to "int". This means that your so-called "plain variables" are ints. --Dan Henry
IMO, this is a jolly good reason for *not* having multiple comma-separated variables declared together! It's safest to stick to one per line; eg: int a; int b; int c; rather than: int a, b, c;