HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
CommonFunctions.c
Go to the documentation of this file.
1 
6 #include <stdio.h>
7 #include <basic.h>
8 #include <common.h>
9 
10 
16  int a,
17  char *A,
18  int width
19  )
20 {
21  if (width > _MAX_STRING_SIZE_-1) {
22  fprintf(stderr,"Error in GetStringFromInteger(): requested width is larger than _MAX_STRING_SIZE_.\n");
23  }
24  int i;
25  for (i=0; i<width; i++) {
26  char digit = (char) (a%10 + '0');
27  a /= 10;
28  A[width-1-i] = digit;
29  }
30  A[width] = 0;
31  return;
32 }
33 
Some common functions used here and there.
Some basic definitions and macros.
#define _MAX_STRING_SIZE_
Definition: basic.h:14
void GetStringFromInteger(int a, char *A, int width)