Program to write some contents into a file using file
operations with proper error messages.
Answer Posted / manvitha
//writing into a file
main()
{
char c;
FILE *fp;
fp=fopen("infor.dat",'w');
printf("enter data \n enter tab & enter a stop\n");
do
{
c=getchar();
put c(c,fp);
}while(c!='\t');
fclose(fp);
getch();
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is string in c language?
What are the differences between new and malloc in C?
How can you allocate arrays or structures bigger than 64K?
What is meant by preprocessor in c?
Why do we use int main?
Can we change the value of static variable in c?
Can we declare a function inside a function in c?
pierrot's divisor program using c or c++ code
Is c a great language, or what?
Do you know the difference between exit() and _exit() function in c?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
Is flag a keyword in c?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
What is structure in c definition?
What is the heap?