How to create a folder in C (need to run on both Linux and Windows)

后端 未结 3 1526
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 02:52

I don\'t have much experience and I\'m on a C project where I need to create & delete folders and the program must run on both Linux and Windows.

I saw few solut

3条回答
  •  借酒劲吻你
    2021-01-03 03:23

    It is not what you should do in production code, but I had to mention that one liner solution no #ifdef etc. I am Assuming you run it from the same path you want to create the directory in:

    system("mkdir my_dir");
    

提交回复
热议问题