logo

CuriousTab

CuriousTab

Strings problems


  • 1. If the size of pointer is 32 bits What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        char a[] = "Visual C++";
        char *b = "Visual C++";
        printf("%d, %d\n", sizeof(a), sizeof(b));
        printf("%d, %d", sizeof(*a), sizeof(*b));
        return 0;
    }
    

  • Options
  • A. 10, 2
    2, 2
  • B. 10, 4
    1, 2
  • C. 11, 4
    1, 1
  • D. 12, 2
    2, 2
  • Discuss
  • 2. What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        char str[7] = "CuriousTab";
        printf("%s\n", str);
        return 0;
    }
    

  • Options
  • A. Error
  • B. CuriousTab
  • C. Cannot predict
  • D. None of above
  • Discuss

First 2 3 4 5