answersLogoWhite

0

Why you use zero instead of NULL in c plus plus?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

In C++ NULL is defined as 0. It's a design failure, will be fixed with a new 'nullptr' keyword.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why you use zero instead of NULL in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the use of null pointer?

Pointer is a variable that stores address of a variable . A NULL Pointer a pointer that doesn't point to anything, it is a literal zero .Some people ,notably C++ programmers, prefer to use 0 rather than NULL.


Difference between null and empty in c plus plus?

NULL is a constant with the value zero. It is typically used with pointers to signify the pointer is valid, but it does not store a valid memory address. In other words it points at nothing in particular. It is nullified. All pointers that are not currently in use must be nullified to signify the fact they are not in use. The term empty applies to arrays that have no elements: empty arrays. We also use the term when referring to empty strings. A string is simply an array of char, but while null-terminated strings always have at least one char, the null-terminator, the string itself is empty.


What is null point in C programming?

I'm going to go out on a limp here, and guess you mean "Null Pointer." Well, it's a pointer to nothing. For most systems, it's 0, but rather use NULL instead.


How do you get Null in Metal Gear Solid portable ops plus?

Knock him out. Use a weapon that uses tranquilizer rounds.


How do you use get line function in c plus plus?

string s; istream::getline(std::cin, s ); In the above example, s will contain whatever data is extracted from the standard input stream, as a null-terminated string. int x; istream::getline( std::cin, x ); In the above example, x will be non-zero if the standard input stream has a non-zero value. If the input stream is non-numeric, x will be zero.


On gaia how do you get the null crystal on zen gardens in zOMG?

You could get any null in any place by going to that particular place and 'attune' the null/use it to go to null chamber. When you use the null to zen gardens, it will lead you there.


Why you dont use simple wire instead of zero resistance?

A: if you have many people will more then glad to use it.


What is called pointers-c plus plus?

Yes, C++ has pointers, which are references to memory locations. which are variables that store memory addresses, or NULL (zero). If the pointer is non-NULL, the pointer is said to dereference the object (or variable) residing at the stored memory address, which permits indirect access to that object so long as the object remains in scope.


Solution to null pointer assignment error?

Answer#ifndef NULL# define NULL ((void*)0)#endifAnswerDon't use pointers that contain NULL-value. Eg:int *myptr= NULL;...*myptr = 32; /* wrong */


Why use a null set?

It is possible to specify a condition which can't be fulfilled, for example, the intersection of two sets that have no element in common. The result would have no elements. Not allowing this kind of operation would be more complicated than defining a null set (or empty set) that has zero elements.


What is 0 plus 0 equal to?

( . ) ( .) zero please use this for research or homework childish!


Why strcat(string'!') not work in C program?

The strcat() function has the following protocol:char* strcat (char* destination, char* source);The function appends the source string to the destination string and returns the destination string.The destination string must be a null-terminated character array of sufficient length to accommodate strlen (source) plus strlen (destination) characters, plus a null-terminator. The existing null-terminator and subsequent characters of destination are overwritten by characters from the source string, up to and including the source string's null-terminator.strcat (string, '!') will not work because '!' is a character literal (ASCII code 33 decimal), not a null-terminated character array. Use "!" instead of '!'.Example:char string[80]; // character arraystrcpy (string, "Hello world");strcat (string, "!");puts (string);