Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Concept Learning Code Sheets
Empty File Creation #7479 

Creating an empty file using ofstream class

File Creation with fail() check #7481 

Checking if file could be created after the creation object has been made along with filename parameter.

File Creation with ! check #7484 

Checking if file could be created using !<obj> check after the creation object has been made along with filename parameter.

Solved Problems
File and string related header files #5191 

The following C++ code during compilation reports errors as follows:
Error: ‘ofstream’ not declared
Error: ‘strupr’ not declared
Error: ‘strcat’ not declared
Error: ‘FIN’ not declared
Write the names of the correct header files, which must be included to compile the code successfully:

void main()
{
  ofstream FIN("WISH.TXT");
  char TEXT2[]="good day";
  char TEXT1[]="John!";
  strupr(TEXT2);
  strcat(TEXT1, TEXT2);
  FIN<<TEXT1<<endl;
}
The following C++ code during compilation reports errors as follows: Error: ‘ofstream ...
Exam Questions
CBSE12A-2018-01B  File and string related header files #5191 

The following C++ code during compilation reports errors as follows:
Error: ‘ofstream’ not declared
Error: ‘strupr’ not declared
Error: ‘strcat’ not declared
Error: ‘FIN’ not declared
Write the names of the correct header files, which must be included to compile the code successfully:

void main()
{
  ofstream FIN("WISH.TXT");
  char TEXT2[]="good day";
  char TEXT1[]="John!";
  strupr(TEXT2);
  strcat(TEXT1, TEXT2);
  FIN<<TEXT1<<endl;
}
The following C++ code during compilation reports errors as follows: Error: ‘ofstream ...

Code Sheets:3  Solved Problems:1  Exam Questions:1 
Back