logo

CuriousTab

CuriousTab

Discussion


Home C Programming Structures, Unions, Enums Comments

  • Question
  • Can a structure can point to itself?


  • Options
  • A. Yes
  • B. No

  • Correct Answer
  • Yes 

    Explanation
    A structure pointing to itself is called self-referential structures.

  • Structures, Unions, Enums problems


    Search Results


    • 1. size of union is size of the longest element in the union

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 2. Can we have an array of bit fields?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 3. If a char is 1 byte wide, an integer is 2 bytes wide and a long integer is 4 bytes wide then will the following structure always occupy 7 bytes?
      struct ex
      {
          char ch;
          int i;
          long int a;
      };
      

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 4. It is not possible to create an array of pointer to structures.

    • Options
    • A. True
    • B. False
    • Discuss
    • 5. A structure can contain similar or dissimilar elements

    • Options
    • A. True
    • B. False
    • Discuss
    • 6. If the following structure is written to a file using fwrite(), can fread() read it back successfully?
      struct emp
      {
          char *n;
          int age;
      };
      struct emp e={"CuriousTab", 15};
      FILE *fp;
      fwrite(&e, sizeof(e), 1, fp);
      

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 7. Is there easy way to print enumeration values symbolically?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 8. The elements of union are always accessed using & operator

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 9. Is it necessary that the size of all elements in a union should be same?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 10. By default structure variable will be of auto storage class

    • Options
    • A. Yes
    • B. No
    • Discuss


    Comments

    There are no comments.

Enter a new Comment