how to get the starting address of file stored in harddisk
through 'C'program.
Answer Posted / amvel
U can use FILE pointer, to find the address of a file in ur
hard disk.
What u hav to do is, Just pass the directory of the file to
lib function fopen(), to which u wanted to know the
address, and assign the return value of the function to a
FILE pointer. Now the file pointer holds the address of the
file.
Lets, look at the below code for better clarity.
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp ;
char ch ;
fp = fopen("C:\\Documents and
Settings\\Vadivelt\\file.txt", "w+");
/*Gives the starting adds of ur file in the hard disk*/
printf("%d \n", fp);
_getch();
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the use of getchar functions?
find the sum of two matrices and WAP for it.
What is New modifiers?
What do you mean by recursion in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What is a list in c?
How can you pass an array to a function by value?
Explain the difference between call by value and call by reference in c language?
What is difference between arrays and pointers?
What is wrong in this statement? scanf(ā%dā,whatnumber);
All technical questions
How can I copy just a portion of a string?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
List some applications of c programming language?
Explain what is the difference between far and near ?