In the below snippet,Rewind() wraps up the file but still the no of records exceed the MAX value set.
if(no_of_msg_records >= MAX)
{
rewind(fp_msg);
no_of_msg_records=0;
}
ie the no_of_msg_records in the file exceeds MAX value.
megha10
0
Newbie Poster
Recommended Answers
Jump to Posthow was the file opened? The file needs to be opened for either reading only or both reading and writing, such as in the example here
Jump to PostWhere is the value for no_of_msg_records being set ?
Are you sure no_of_msg_records contains the correct value before the if statement ?
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
megha10
0
Newbie Poster
abhimanipal
91
Master Poster
megha10
0
Newbie Poster
abhimanipal
91
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.