Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

write to a File     *  very simple *

Posted on 2000-05-12
1
Medium Priority
?
196 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 40 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays 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.
Suggested Courses

926 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