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.Quote:
Originally Posted by Brafil
Printable View
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.Quote:
Originally Posted by Brafil
Apparently not... see laserlights post below...
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.Quote:
Originally Posted by transgalactic2
in the start matsp said that it
works
Code:char arr[256]={0};
Define "works"?Quote:
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"?
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.Quote:
Originally Posted by transgalactic2
That is because arr[0] is initialised to 0, then arr[1] to arr[255] are zero initialised.Quote:
Originally Posted by transgalactic2
thanks