πŸ“Š C Programming
Q. What is the output of C program with structure array pointers?
Code:
int main()
{
    struct car
    {
        int km;
    }*p1[2];
    struct car c1={1234};
    p1[0]=&c1;
    printf("%d ",p1[0]->km);
    return 0;
}
  • (A) 0
  • (B) 1
  • (C) 1234
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1234

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
194
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
94%
Success Rate