I am calling a dll in labview where the dll gets two numbers for summing and then has to be saved in txt file. Summing works perfectly fine, but writing it in the txt, doesn't work. When I a create separate c project and saving some random number in the txt with the same code then it works. Where is the trick?
Dll:
#include<stdio.h>
FILE *ptr_file;
int __declspec(dllexport) ArrayFind(int a, int b, int* c);
int __declspec(dllexport) ArrayFind(int a, int b, int* c)
{
*c = a + b;
ptr_file = fopen("C:\\FILE.txt", "w");
fprintf(ptr_file, "%d\n", c);
fclose(ptr_file);
return;
}