Home / C Programming / Pointers :: Discussion

Discussion :: Pointers

  1. Will the program compile?

    #include 
    int main()
     {    
        char str[5] = "FRESHERGATE";   
        return 0; 
     } 
    

     

  2. A.

    True

    B.

    False

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    C doesn't do array bounds checking at compile time, hence this compiles.

    But, the modern compilers like Turbo C++ detects this as 'Error: Too many initializers'.

    GCC would give you a warning.

     


Be The First To Comment