NULL is an implementation defined null pointer constant, so whether it is 0 or (void*)0 is implementation defined. I do not think that the name NUL is actually defined in standard C.Originally Posted by Brafil
NULL is an implementation defined null pointer constant, so whether it is 0 or (void*)0 is implementation defined. I do not think that the name NUL is actually defined in standard C.Originally Posted by Brafil
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Apparently not... see laserlights post below...
Last edited by Bladactania; 04-20-2009 at 09:18 AM. Reason: Oops
No. I already told you that you can use an initialiser to initialise the chars to something other than the null character, though it may be tedious to do so by hand. Stop talking about "NULL char" since it can be confused with the NULL macro, which would then obfuscate your intending meaning.Originally Posted by transgalactic2
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
in the start matsp said that it
works
Code:char arr[256]={0};
Define "works"?Originally Posted by transgalactic2
You say that you want to initialise the elements of the array to something other than the null character, then you say that an example that initialises the elements of the array to a null character "works"?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Zero yes, NULL no. Leave NULL out of this, not even in the ballpark.
i understand that other values dont works
but this value(i cant decide its name)
does puts in every cell 0Code:char arr[256]={0};
It is an int literal 0, so you can call it 0, or you can call it a null character since char is the destination type.Originally Posted by transgalactic2
That is because arr[0] is initialised to 0, then arr[1] to arr[255] are zero initialised.Originally Posted by transgalactic2
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
thanks