I have an C mex S function which can print output to the .txt file. This code inside mdlStart(SimStruct *S) creates datafile.txt file and appends the output.
void** pwork = ssGetPWork(S);
FILE *datafile;
datafile = fopen("datafile.txt","a");
pwork[0] = datafile;
So now I want to dynamically get the filename of .txt file from user through S function mask . so , How can I receive string value of filename from mask inside S function.