Hello I have to make a program that involves writing a matrix in a binary file, but it has to have a space between every number written. Also the first fwrite has to have the size of the lines and columns. So instead of making something like:
fwrite( &n, sizeof( int ), 1, fw );
fwrite( &space, sizeof( char ), 1, fw );
fwrite( &m, sizeof( int ), 1, fw );
or
space = ' ';
fwrite( &temp, sizeof( int ), 1, fw );
fwrite( &sapce, sizeof( char ), 1, fw );
I wanted to see if something like this, would be possible.
fwrite( "&n &m", 2*sizeof( int ) + sizeof( char ), 1, fw );
fwrite( "&n ", sizeof( int ) + sizeof( char ), 1, fw );
may be you can try this: