Solved

write to a File     *  very simple *

Posted on 2000-05-12
1
175 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
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…
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 how to create, access, and change arrays in the C programming language.

763 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

9 Experts available now in Live!

Get 1:1 Help Now