0 like 0 dislike
18 views
in Computer Science by (1.0m points)
What is file pointer?

1 Answer

0 like 0 dislike
by (1.0m points)
I am trying to understand what does file pointer increment means .

I have declared file pointer fp and assuming that when I use fopen for any file (say test99.txt) and try to read it then compiler dynamically allocate memory ( in heap ofcourse because I think internally fopen make use of malloc in order to put file in main memory) and once file stream/data of file is put in memory then I am assuming fp contains the start address of that file stream. Now incrementing fp by 1 (++fp) which is pointer of type FILE will increase/hop the position of fp by total size of data/stream inside that file test99.txt. If not, and let's say incrementing fp will move fp pointer to the next character (1 byte) within the file stream then why is the below output ? ( why fp moved by 16 bytes:see the diff) Where am I misunderstanding .

Related questions

0 like 0 dislike
1 answer 32 views
asked Feb 11, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 20 views
asked Jan 7, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 20 views
asked Feb 14, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 80 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 62 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 54 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 34 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
0 answers 66 views
0 like 0 dislike
1 answer 48 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 54 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...