Solved

write to a File     *  very simple *

Posted on 2000-05-12
1
177 Views
Last Modified: 2010-04-15
I don't know why, but I could write into a file with my VC6.00 compiler,
using File descriptors.

anyone have a short
fd=open(FILENAME, O_WRONLY)
write(fd, buf, BufSize)

code that works ?!

Yair
0
Comment
Question by:yairy
1 Comment
 
LVL 5

Accepted Solution

by:
laeuchli earned 10 total points
ID: 2804814
the very easiest way is this:
#include<stido.h>//I don't think you need any other inculdes.
void main()
{
FILE *file=fopen("C:\\test.txt","w");
fprintf(file,"This is a test");
fclose(file);
}
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now