binary file problem
okay this is a piece of code....
int fdf; int rcf; fdf=open("output7",O_WRONLY|O_CREAT|O_TRUNC,0666); rcf=write(fdf,genespect,len); close(fdf); genespect is pointer to a double array it was declared as double *genespect; genespect=(double*)malloc(len*sizeof(double)); after the execution i see that the file output7 has been made.it probably has legit data too...i cant open it....gedit does not open it ..... i basically want this to be an ascii file with one number per line... how do i do that? i know it isnt like that cos' gnuplot isnt able to plot it(it requires the file to be in one number per line format) thanks, dhananjay |
You're best off using stdio functions:
Code:
fp = fopen("output7", "w"); |
itsme86 already told, but I'd already made up an example. I'll post it anyway.
Code:
#include <stdio.h> |
Seriously man,you guys are lifesavers!!!!!!
it worked!! dhananjay |
All times are GMT -5. The time now is 06:02 AM. |