Removing null characters

Once when I was compiling my code under the Linux environment, and bash told me that there were a lot of errors in my code - because my code had a lot of null characters. I used the following command to remove the null characters:

tr < file-with-nulls -d ‘\000’ > file-without-nulls

Once I removed the null characters, my code ran alright.