how to create a simple document file to drive D in harddisk



 DEVELOP > c-Plus-Plus > how to create a simple document file to drive D in harddisk

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "mohamed azaz"
Date: 31 Jan 2008 07:45:16 AM
Object: how to create a simple document file to drive D in harddisk
hi
I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code
please answer me Quickly
bye bye
.

User: "Mike Wahler"

Title: Re: how to create a simple document file to drive D in harddisk 31 Jan 2008 08:59:13 AM
"mohamed azaz" <mohaz14@yahoo.com> wrote in message
news:44b9afd7-51aa-4283-a3d8-9bcd47d251f2@v17g2000hsa.googlegroups.com...

hi

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code

#include <fstream>
int main()
{
std::ofstream ofs("D:file.doc");
return 0;
}
-Mike
.
User: "Hans Mull"

Title: Re: how to create a simple document file to drive D in harddisk 31 Jan 2008 09:38:15 AM
Mike Wahler schrieb:

"mohamed azaz" <mohaz14@yahoo.com> wrote in message
news:44b9afd7-51aa-4283-a3d8-9bcd47d251f2@v17g2000hsa.googlegroups.com...

hi

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code


#include <fstream>

int main()
{
std::ofstream ofs("D:file.doc");
return 0;
}

-Mike


Use D:\\file.txt, so its more secure that it is really opened
Kind regards, Hans
.
User: "Jim Langston"

Title: Re: how to create a simple document file to drive D in harddisk 31 Jan 2008 07:57:56 PM
Hans Mull wrote:

Mike Wahler schrieb:

"mohamed azaz" <mohaz14@yahoo.com> wrote in message
news:44b9afd7-51aa-4283-a3d8-9bcd47d251f2@v17g2000hsa.googlegroups.com...

hi

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code


#include <fstream>

int main()
{
std::ofstream ofs("D:file.doc");
return 0;
}

Use D:\\file.txt, so its more secure that it is really opened

Also, D:/file.txt will also work, yes, even in windows.
--
Jim Langston
tazmaster@rocketmail.com
.
User: "Mike Wahler"

Title: Re: how to create a simple document file to drive D in harddisk 04 Feb 2008 10:30:00 AM
"Jim Langston" <tazmaster@rocketmail.com> wrote in message
news:L0voj.402$az7.1@newsfe07.lga...

Hans Mull wrote:

Mike Wahler schrieb:

"mohamed azaz" <mohaz14@yahoo.com> wrote in message
news:44b9afd7-51aa-4283-a3d8-9bcd47d251f2@v17g2000hsa.googlegroups.com...

hi

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code


#include <fstream>

int main()
{
std::ofstream ofs("D:file.doc");
return 0;
}


Use D:\\file.txt, so its more secure that it is really opened


Also, D:/file.txt will also work, yes, even in windows.

--
Jim Langston
tazmaster@rocketmail.com

.

User: "Mike Wahler"

Title: Re: how to create a simple document file to drive D in harddisk 04 Feb 2008 10:32:09 AM
"Jim Langston" <tazmaster@rocketmail.com> wrote in message
news:L0voj.402$az7.1@newsfe07.lga...

Hans Mull wrote:

Mike Wahler schrieb:

"mohamed azaz" <mohaz14@yahoo.com> wrote in message
news:44b9afd7-51aa-4283-a3d8-9bcd47d251f2@v17g2000hsa.googlegroups.com...

hi

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code


#include <fstream>

int main()
{
std::ofstream ofs("D:file.doc");
return 0;
}


Use D:\\file.txt, so its more secure that it is really opened

Why would specifying a root directory make the open more
likely to succeed?


Also, D:/file.txt will also work, yes, even in windows.

OP never said *where* on drive D.
-Mike
.




User: "Victor Bazarov"

Title: Re: how to create a simple document file to drive D in harddisk 31 Jan 2008 08:05:33 AM
mohamed azaz wrote:

I want to know how can I create a simple doc file to drive D in
Harddisk by using c++ code

This is system-specific. Many systems simply don't have "drive"
or "drive D" or "Harddisk". On the systems that do, you would
open a file stream for write and give it a name [of a file] that
doesn't exist, and that might cause the system to create a file
for you (which may happen only when you close that stream).
std::ofstream file("D:\\simple_doc_file");
file << "blah";
file.close();

please answer me Quickly

You could only talk in this manner when you're in the position
of power. Even then I wouldn't recommend it.

bye bye

I hope you mean it.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER