Carmen Code
 All Classes Files Functions Variables Macros Pages
Functions
FileWrite.cpp File Reference

Writes in binary or ASCII mode the real number arg into the file f. The global parameter DataIsBinary determines this choice. More...

#include "Carmen.h"
Include dependency graph for FileWrite.cpp:

Functions

int FileWrite (FILE *f, const char *format, real arg)
 Writes in binary or ASCII mode the real number arg into the file f with the format format. The global parameter DataIsBinary determines this choice. More...
 

Detailed Description

Writes in binary or ASCII mode the real number arg into the file f. The global parameter DataIsBinary determines this choice.

Function Documentation

int FileWrite ( FILE *  f,
const char *  format,
real  arg 
)

Writes in binary or ASCII mode the real number arg into the file f with the format format. The global parameter DataIsBinary determines this choice.

Parameters
fFile name
formatFormat
argArgument
Returns
int
23 {
24  int result;
25  real x;
26 
27  x = arg;
28 
29  if (DataIsBinary)
30  result = fwrite(&x,sizeof(real),1,f);
31  else
32  result = fprintf(f, format, x);
33 
34 
35  return result;
36 }
bool DataIsBinary
Definition: Parameters.cpp:145
#define real
Definition: PreProcessor.h:31

Here is the caller graph for this function: