Solved

write to a File     *  very simple *

Posted on 2000-05-12
1
182 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cURL: stopping a http transaction before it's finished 3 122
Trouble linking program with -lcrypt 3 149
Problem to ASCII 1 180
convert char array to number in c 5 85
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops 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.

777 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