123456789101112131415161718192021222324252627 |
- #include "printFunction.h"
- void printFloatVector(double* V, int length, char* fn) {
- int j;
- FILE* f = fopen(fn, "w");
- if (f != NULL) {
- for (j = 0; j < length; j++) {
- fprintf(f, "%20.18f\n", V[j]);
- }
- fclose(f);
- }
- else {
- printf("Error during writing file %s.\n", fn);
- }
- }
- void printIntVector(int* V, int length, char* fn) {
- int j;
- FILE* f = fopen(fn, "w");
- if (f != NULL) {
- for (j = 0; j < length; j++) {
- fprintf(f, "%d\n", V[j]);
- }
- fclose(f);
- }
- else {
- printf("Error during writing file %s.\n", fn);
- }
- }
|