io - c++: why open files using .open("a: -


i'm going through book "object-oriented programming in c++" robert lafore. in chapter called "streams , files", files opened using instance ifstream is("edata.dat", ios::binary); , syntax file.open("a:test.dat"); (after object file has been created). syntax ifstream is("edata.dat", ios::binary); explained , understand it, doesn't explain a: means or why 1 case preferable on other one. tried google it, i'm not sure search for. appreciated.

a:test.dat valid path on dos , windows systems. means "the file named 'test.dat' on current directory of drive 'a'".

drives "a" , "b" on dos , windows reserved floppy disk drives. modern computers don't come floppy drives anymore, , drives not accessible. they're still reserved though modern windows, why first storage filesystem starts "c".

if replace a:test.dat c:test.dat, refer "test.dat" file on current directory of "c" drive.

the current directory on windows can changed using _chdir() function. default, it's root directory of drive.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -