How can I make this code, that works in Linux, work in Windows. Ideally I need to have a version of it that works on both platforms.
#include <fcntl.h>
#include <iostream>
using namespace std;
int main()
{
int mode = O_TRUNC | O_RDWR | O_CREAT;
int myFilDes;
myFilDes = open ("/home/user23/data.bin", mode, S_IRUSR | S_IWUSR);
if(myFilDes < 0)
cout<<"Create failed!"<<endl;
close(myFilDes);
}