Having trouble with fstream in Xcode

后端 未结 2 1479
渐次进展
渐次进展 2021-01-25 03:48

I\'m having trouble validating the existence of REGISTER.txt for input purposes in a function (see below). My understanding is that if the file doesn\'t exist, then the file won

2条回答
  •  鱼传尺愫
    2021-01-25 04:31

    Normally it would be the directory where your program lives. If you want to make sure, use _getcwd to get the current directory or just include the parent directory.

    char *_getcwd( char *buffer, int maxlen );

    However, you should try not to use the full path for the reason it might not be the same when you run your program on another computer.

提交回复
热议问题