i get a debug assertion failure when i call a text file in v c ++. how to solve the error actually. it states debug assertion failure fseeki64.c line 61 stream !=null.

Recommended Answers

All 3 Replies

could you please post your code

You know we can't see your code, so I can't help you.

> it states debug assertion failure fseeki64.c line 61 stream !=null.
You opened a file, say

FILE *fp = fopen("doofus.txt", "r" );

You then tried to seek somewhere - I guessed that fseeki64.c

> stream !=null
How many parameters does fseek() have?
Which one's are
a) pointers (the message says NULL)
b) could be interpreted as being a stream of some sort.

int fseek(FILE *stream, long offset, int whence);
Mmm, only one thing is a pointer, and it's called stream.

Answer, you passed NULL to fseek.
In other words, you blindly assumed that your file open succeeded and you were wrong.

Improve the error checking in your code.

commented: I want your crystal ball. :icon_razz: +26
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.