How do I write a binary dump file of an array in my testbench

In reply to rgarcia07:

Ok, you have solved 1 problem with the ‘wb’.
When printing the character 8’0A, it is no longer preceded by a 8’h0D.
However, when sending character 8’00, the output is still 8’h20.
Unless there is a different way of sending characters, I still can’t seem to write a 8’h00.

Unfortunately, there is no $fputc command. Is there any other way to send binary characters I do not know about.

Even $fwrite(fout_pointer,8’h00); only outputs in ascii text → " 0".

Is there a way to maybe define a set of characters in a string to be sen which contain a 8’h00. I know that in old school C development, 8’h00 is usually reserved to delineate an end of a string when using the old fopen/fprint/fputc/fgetc.