Solved

"fgets" function fails

Posted on 1997-11-25
1
290 Views
Last Modified: 2006-11-17
I open an ASCII file with some control charactes in it (it is a printer output) with the function "fopen" for reading. Then, I read the lines of the file with the function "fgets". My problem is: As soon as a line contains the character 0x1A, the following call of "fgets" returns NULL, even if there are more lines to read.
0
Comment
Question by:mskohut
1 Comment
 
LVL 3

Accepted Solution

by:
rmichels earned 100 total points
Comment Utility
Code 1A (ctrl-Z) is an end of file character.  When dealing with text streams you cannot read past this character.  Can you open the file in binary mode?
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now