QueryCAT Logo
Search 5,000,000+ questions and answers.

Frequently Asked Questions

What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

OOPS FAQ - Page 7
Latest Answer: NULL is a macro which contains the value 0 (on most implementations). this is the one used to initia...

Is a null statement a null pointer?

Infrequently Asked Questions in comp.lang.c
No. A null pointer is a pointer where all of the address bits are zero (no matter what the segment bits are), and can be obtained by typing '(char *) (int) 0'. A null statement is not a pointer to anything. They are not interchangeable, although you can combine them to get an effectively-null statement, such as NULL;. This does not buy you anything. [a] Send large donations, checks, and money orders to the author of the FAQ, or the moderator of the group, whichever you prefer. See similar questions...

what is a NULL Pointer? Whether it is same as an uninitialized pointer?

OOPS FAQ - Page 7
Latest Answer: NULL pointer is pointer which is not pointing to anything in the memory. NULL is defined as (v... See similar questions...

What is this infamous null pointer, anyway?

The C Language FAQ
The language definition states that for each pointer type, there is a special value -- the "null pointer" -- which is distinguishable from all other pointer values and which is not the address of any object. That is, the address-of operator & will never yield a null pointer, nor will a successful call to malloc. See similar questions...

How do I "get" a null pointer in my programs?

The C Language FAQ
According to the language definition, a constant 0 in a pointer context is converted into a null pointer at compile time. That is, in an initialization, assignment, or comparison when one side is a variable or expression of pointer type, the compiler can tell that a constant 0 on the other side requests a null pointer, and generate the correctly-typed null pointer value. See similar questions...

What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

Memory Allocation
It's hard to say. The Standard doesn't say that systems can act this way, but it doesn't explicitly say that they can't, either. (Such a ''deferred failure'' implementation would not seem to conform to the implied requirements of the Standard.) The conspicuous problem is that, by the time the program gets around to trying to use the memory, there might not be any. The program in this case must typically be killed by the operating system, since the semantics of C provide no recourse. See similar questions...

This is strange. NULL is guaranteed to be 0, but the null pointer is not?

Frequently Asked Questions: C Language (abridged)
A "null pointer" is a language concept whose particular internal value does not matter. A null pointer is requested in source code with the character "0". "NULL" is a preprocessor macro, which is always #defined as 0 (or ((void *)0)). See similar questions...

I'm confused. NULL is guaranteed to be 0, but the null pointer is not?

The C Language FAQ
The conceptual null pointer, the abstract language concept defined in question 1.1. It is implemented with... The internal (or run-time) representation of a null pointer, which may or may not be all-bits-0 and which may be different for different pointer types. The actual values should be of concern only to compiler writers. Authors of C programs never see them, since they use... The source code syntax for null pointers, which is the single character "0". It is often hidden behind.. See similar questions...

If NULL and 0 are equivalent as null pointer constants, which should I use?

Null Pointers
Many programmers believe that NULL should be used in all pointer contexts, as a reminder that the value is to be thought of as a pointer. Others feel that the confusion surrounding NULL and 0 is only compounded by hiding 0 behind a macro, and prefer to use unadorned 0 instead. There is no one right answer. (See also questions 9.4 and 17.10.) C programmers must understand that NULL and 0 are interchangeable in pointer contexts, and that an uncast 0 is perfectly acceptable. See similar questions...

Is a run-time integral value of 0, cast to a pointer, guaranteed to be a null pointer?

All Questions
How can I access an interrupt vector located at the machine's location 0? If I set a pointer to 0, the compiler might translate it to some nonzero internal null pointer value. See similar questions...

Why isn't a pointer null after calling free()?

Frequently Asked Questions: C Language (abridged)
C's pass-by-value semantics mean that called functions can never permanently change the values of their arguments. See similar questions...

Explore Other Topics

I'd like a copy of my marriage license, where do I go?
If my spouse is issued with an H4 visa, can she work in the USA?
What are the differences between Standard and High Definition?
How do I make a call using Prepaid 1516 IDD?
How do I register my boat?
Are there any side effects from using Sensodyne Pronamel?
How do I qualify for unemployment insurance benefits?
How do I apply for Public Housing or Section 8?
How do I do fund transfer from POSB/DBS ATM?
What is the Difference between a Class A and Class B License?
I am tired of my curly perm, can I get my straight hair back?
More Questions >>

© Copyright 2007-2012 QueryCAT
About • Webmasters • Contact