Answered Questions

  • What is a static function?

    A static function is a function whose scope is limited to the current source file. Scope refers to the visibility of a function or variable. If the function or variable is visible outside of the current source file, it is said to have global, or external, scope. If the function or variable is not visible outside of the current source file, it is said to have local, or static, scope.

    i_spy

    • Dec 25th, 2007

    Suppose void a(){} is defined in file1.c. If you declare it extern in file2.c then you can use it in file2.c. So its scope in not within file1.c. But if you declare it as static in file1.c then it can not be used in any other file.

  • Array is an lvalue or not?

    An lvalue was defined as an expression to which a value can be assigned. Is an array an expression to which we can assign a value? The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x[5], y[5]; x = y; Additionally, you might want to copy the whole...

    jbode

    • Nov 30th, 2010

     Per the C Language Standard (hoping the posting software doesn't munge the following so that it's completely unreadable): ---------------------6.3.2.1 Lvalues, arrays, and function desig...