1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Citrus2011 [14]
3 years ago
11

What function can be used to detect when the end of an input file has been reached?

Computers and Technology
1 answer:
il63 [147K]3 years ago
7 0

Answer:

getc() or feof() in c/c++.

Explanation:

getc() returns EOF(End of File) when the end of the file reached is reached but it is not efficient because it also return EOF when it fails.

feof() returns non-zero value when the EOF is reached otherwise it return 0.So feof() is an efficient method to read a file.

For example:-

#include <stdio.h>    

int main()  

{  

 FILE *f = fopen("sample.txt", "r");  

 int c = getc(f);  

 while (c!= EOF)  

 {  

    putchar(ch);  

   ch = getc(f);  

 }  

 if (feof(f))  

    printf("\n File has ended.");  

 else  

    printf("\n Reading not happened.");  

 fclose(f);

 getchar();  

 return 0;  

}

You might be interested in
Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
Tju [1.3M]

Answer:

Yahoo! mail

Explanation:

In the context, Dona travels most often around the world. While traveling, she has to access her emails from different location and at different times. But in order to keep her luggage light, she never carries the laptop with her. Therefore, Donna uses Yahoo! mail to access her emails.

Donna uses Yahoo mail because she can install the Yahoo! mail app in her phone or tablets which is small in size and of light weight. She is able to organize her Outlooks,  Google mails and  Yahoo accounts. In Yahoo! mail, Donna is also able to sign in with her any of the non yahoo accounts and it also provides free cloud storage space.

8 0
3 years ago
Read 2 more answers
Which statements describe the elements of the email function? Check all that apply.
liq [111]

Which statements describe the elements of the email function? Check all that apply.

Messages are delivered from one email address to another.

An email address can be used to identify the sender in Contacts.

The local part of the email address contains the user name.

The domain part of the email address can a business name.

Answer:

The local part of the email address contains the user name.

The domain part of the email address can a business name.

Explanation:

Elements of email function include the local part of the email which can contain the username, the domain part of the email, the sender, receiver, and other components.

8 0
4 years ago
Read 2 more answers
Consider the following program segment. ifstream inFile; //Line 1 int x, y; //Line 2 ... //Line3 inFile &gt;&gt; x &gt;&gt; y; /
AnnyKZ [126]

Answer:

inFile.open("progdata.dat");

Explanation:

5 0
3 years ago
from january 2005 through july 2015, approximately how many electronic data records in the United States were breached, exposing
Brums [2.3K]
From January 2005 through July 2017, approximately 853 million electronic data records in the US were breached.
This allowed the attackers to take control over people's personal data, such as their various credit card numbers, and other important data, as well as their addresses, etc. The cyber police, as well as the regular police have been working hard to stop this from happening, but the hackers are very strong and smart.
4 0
3 years ago
It is ethical to use ICT in early years
Dahasolnce [82]
Early years of what? ICT is generally ethical as it’s just stressing unified communications of different telecommunications/IT devices
3 0
3 years ago
Other questions:
  • Which method of encryption is based on physics principles?
    5·1 answer
  • Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
    5·1 answer
  • When a field is declared static there will be ________. Group of answer choices two reference copies of the field for each metho
    14·1 answer
  • The addElement operation for the linked implementation must determine the parent of the next node to be inserted. Why?
    5·1 answer
  • Bill's manager has asked him to send all staff members the directions for checking out the new projector. In one to two sentence
    14·2 answers
  • What is the difference between a sequential program and an event-driven program?
    9·1 answer
  • PLEASE HELP!! WILL GIVE BRAINLIEST!!
    14·2 answers
  • What is the purpose of the New Window command?
    7·2 answers
  • The cameras picture review function allows you to look at the _ you've taken
    8·1 answer
  • Alice is watching a speech over the internet. what type of message is alice attending to?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!