Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3484536
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:47:58+00:00 2026-05-18T10:47:58+00:00

So I was going through some interview questions and I came across one about

  • 0

So I was going through some interview questions and I came across one about void and null pointers, which claims:

a pointer with no return type is called a null pointer. It may be any kind of datatype.

This confused me thoroughly! It seems void and null could be used interchangeably according to this question, and I don’t believe that to be correct. I assumed void to be a return type and null to be a value. But I am just a code-rookie and am not sure I am right.

Please express your views as to what a null pointer is and a void pointer is. I am not looking for difference between null and void.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:47:59+00:00Added an answer on May 18, 2026 at 10:47 am

    The two concepts are orthogonal:

    1. A void pointer, (void *) is a raw pointer to some memory location.
    2. A null pointer is a special pointer that doesn’t point to anything, by definition. It can be a pointer to any type, void or otherwise.

    A void pointer can be null or not:

    void *void_ptr1 = nullptr;
    void *void_ptr2 = malloc(42);
    void *void_ptr3 = new Foo;               // void * can point to almost anything
    void *void_ptr4 = (char*)void_ptr3 + 1;  // even somewhere inside an object
    

    A non-void pointer can also be null or not:

    Foo *f = nullptr;
    Foo *g = new Foo;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was going through some Amazon interview questions on CareerCup.com, and I came across
I was going through some practice coding problems , and i came across one
I was going through some code examples and came across this application which which
Going through some documentation on modifying CGImageRef data, I came across a strange example
while going through some of the mili source code I came across a struct
I've been going through some old code, where I came across some custom defined
I was just going through some codes of C++. Where in I came across
i have been going through some code and came across a statement that somehow
I was going through some VC++ code in a large code-base and came across
I was going through some code and came across a scenario where my combobox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.