C vs Java
5 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which storage class in C is used to store variables with a global scope?

  • Static
  • Extern (correct)
  • Auto
  • Register
  • What is the primary difference between pass by value and pass by reference in C?

  • Pass by value and pass by reference are essentially the same.
  • Pass by value passes the address to the calling function, while pass by reference passes the value.
  • Pass by value passes the value to the calling function, while pass by reference passes the address to the calling function. (correct)
  • Pass by value and pass by reference cannot be used interchangeably.
  • What is the purpose of a void pointer in C?

  • To point to NULL
  • To store the address of a value located in memory
  • To point to a specific memory location (correct)
  • To create generic pointers
  • How is an array different from a pointer in C?

    <p>An array cannot be dereferenced, while a pointer can be dereferenced to access the value it points to.</p> Signup and view all the answers

    What is the main difference between a null pointer and a void pointer in C?

    <p>A null pointer points to nowhere, while a void pointer is a generic pointer.</p> Signup and view all the answers

    More Like This

    Java vs C
    5 questions

    Java vs C

    WellPositionedBliss avatar
    WellPositionedBliss
    Java vs Python
    5 questions

    Java vs Python

    SofterComprehension avatar
    SofterComprehension
    TypeScript vs JavaScript: Key Differences
    14 questions
    Use Quizgecko on...
    Browser
    Browser