c++ - How to create new binary file in cpp -


i new in c++. tried create binary file in c++. not able create it.below source code.

void main() {  ofstream myfile;  myfile.open("d:\get\data.bin",ios::binary);  if (myfile.is_open())   cout<<"hi"<<endl;  else      cout<<"bye"<<endl; } 

i bye output only. required target create binary file in d directory data file name.i using vs2010 , os win 7. providing

you have double backslashes :

"d:\\get\\data.bin" 

have @ escaped characters.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -