Ok i just started C++ about 2 days ago and I have somthing not working and somthing I need to ask, hopfully somone can help me.

Im making a dll to use with a gamemaking software called gamemaker that support using dll's.

oh ya, im using Dev-C++

First, This is not returning 'yes' or 'no', why:

export char* file_write(const char* file_name, const char* file_value){
      const char* done = "no";
           ofstream EmplRecords(file_name);
    EmplRecords << file_value;
    if (EmplRecords.fail()){
                           done = "no";
                                 done = "yes";

And second, how do you delete a file that you've writed to? This is my current code:

export char dos_execute(char temp_name, char command){
          ofstream EmplRecords(temp_name+".bat");
    EmplRecords << command;

Thnx in advance.


Regarding your first question... what is it returning if it isn't returning Yes or No?

Using strings in this way isn't safe. If returned value needed for user output, use class string. If not, the better way to use bool or some kind of numerical constant to return status from function. bool would be more simple and safe.

bool file_write(/*...*/){
 bool status=true;
 return status;

Perhaps a garbage collector could delete the data pointed by const char* done. It would work in non-export function.

to delete a file, you can use unlink function: