query about undeclared identifier and static variable
Posted on 2004-11-01
i have two simple queries
1.if i have an undeclared identifier in a program and i assign it any type say an int or a string,like this
avv="expert"; //declaration without type
does the compiler check the type and assign it implicitly or is it dependant on the host processor?
the above code compiles and prints successfully.
2.If i have a static variable say static int a; declared in a header file say file.h
now if this header file is used in multiple source files,does each source file hold an exclusive copy of the static or is it just one copy,also is there a problem if i do the above?can i change the static variable in any source file and use it?