473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
Jan 31 '08 #1
6 1512
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
Jan 31 '08 #2

"mohamed azaz" <mo*****@yahoo.comwrote in message
news:44**********************************@v17g2000 hsa.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
Jan 31 '08 #3
Mike Wahler schrieb:
"mohamed azaz" <mo*****@yahoo.comwrote in message
news:44**********************************@v17g2000 hsa.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
Jan 31 '08 #4
Hans Mull wrote:
Mike Wahler schrieb:
>"mohamed azaz" <mo*****@yahoo.comwrote in message
news:44**********************************@v17g200 0hsa.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
ta*******@rocketmail.com
Feb 1 '08 #5

"Jim Langston" <ta*******@rocketmail.comwrote in message
news:L0*************@newsfe07.lga...
Hans Mull wrote:
>Mike Wahler schrieb:
>>"mohamed azaz" <mo*****@yahoo.comwrote in message
news:44**********************************@v17g20 00hsa.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
ta*******@rocketmail.com

Feb 4 '08 #6
"Jim Langston" <ta*******@rocketmail.comwrote in message
news:L0*************@newsfe07.lga...
Hans Mull wrote:
>Mike Wahler schrieb:
>>"mohamed azaz" <mo*****@yahoo.comwrote in message
news:44**********************************@v17g20 00hsa.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
Feb 4 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: wj | last post by:
Hi all, I've got some problems uploading files using apache and php on a local Windows PC. I'm using the file upload example from the manual, but i can't get it to work. I don't get an error...
7
by: Patrick Useldinger | last post by:
Hi, I think I found a bug in the write method of file objects. It seems as if before writing each block, a check was done in order to verifiy that there is enough space left for the *whole*...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
0
by: purespam | last post by:
How can I dynamically add file links to a html document? I need to be able to click an image icon and the "Open file" box should pop up where I can select a document from my harddisk. The...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
6
by: Mohammad-Reza | last post by:
Hi I want to extract icon of an exe file and want to know how. I look at the MSDN and find out that I can use ExtractIconEx() Windows API but in there are some changes to that api in c# I made...
3
by: Peter | last post by:
Hello! Please, could you tell me, is it possible to create and stream for example a text file to the browser so that the file is not stored anywhere on a hard drive? User click's a link, eg....
0
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.