How can I write the null character on a Macbook Pro?

You can do this with the Unicode Hex Input method (enable it in System Preferences -> Language & Text pane -> Input Sources tab, then select it from the menu item) by holding Option and typing "0000".

Warning: the null character is not allowed in C-language strings (it's used to indicate the end of the string), so not all programs will cope with it. In TextEdit, for example, you can insert a null into a document, but when you save the document it'll only save the part before the null.


Depends on your terminal, in Terminal.app and Iterm2 you can use ^@ (Ctrl+Shift+2). See here.