Starting Out with C++
8th Edition
ISBN: 9780133888201
Author: GADDIS
Publisher: PEARSON CUSTOM PUB.(CONSIGNMENT)
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 12, Problem 72RQE
fstream inFile("info.dat", ios:in);
int x;
inFile.seekp(5);
inFile ≫ x;
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Written using code C++. Only use the headers <iostream> and <fstream>. Do not utilize any additional headers. Thank you!
Write a program that reads a file encoded with the "rot13" cypher, decodes it, and stores the decoded file. The decoded file name should be the original file name with the word "coded" attached.
what is inFile file stream object ?
Create file
Write data
Read data
Delete data
And print the messages through System.out.println. Use buffer reader to read file
Programming language : Java
Chapter 12 Solutions
Starting Out with C++
Ch. 12.1 - Which file access flag would you use if you want...Ch. 12.1 - Prob. 12.2CPCh. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Write a statement that defines an fstream object...Ch. 12.5 - Assume the file input.txt contains the following...Ch. 12.5 - Describe the difference between reading a file...Ch. 12.5 - What will be stored in the file out.txt after the...Ch. 12.10 - Describe the difference between the seekg and the...
Ch. 12.10 - Describe the difference between the tellg and the...Ch. 12.10 - Describe the meaning of the following file access...Ch. 12.10 - What is the number of the first byte in a file?Ch. 12.10 - Briefly describe what each of the following...Ch. 12.10 - Describe the mode that each of the following...Ch. 12 - What capability does the fstream data type provide...Ch. 12 - Which file access flag do you use to open a file...Ch. 12 - Assume the file data.txt already exists, and the...Ch. 12 - How do you combine multiple file access flags when...Ch. 12 - Should file stream objects be passed to functions...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - How do you read the contents of a text file that...Ch. 12 - What arguments do you pass to a file stream...Ch. 12 - What arguments do you pass to a file stream...Ch. 12 - Prob. 12RQECh. 12 - Prob. 13RQECh. 12 - How do you get the byte number of a files current...Ch. 12 - If a program has read to the end of a file, what...Ch. 12 - How do you determine the number of bytes that a...Ch. 12 - How do you rewind a sequential-access file?Ch. 12 - The _____ file stream data type is for output...Ch. 12 - If a file fails to open, the file stream object...Ch. 12 - The same formatting techniques used with...Ch. 12 - The _____ function reads a line of text from a...Ch. 12 - The ____________ member function reads a single...Ch. 12 - The ________member function writes a single...Ch. 12 - Prob. 24RQECh. 12 - __________ files contain data formatted as...Ch. 12 - Prob. 26RQECh. 12 - Prob. 27RQECh. 12 - The ___________ member function writes raw binary...Ch. 12 - The __________ member function reads raw binary...Ch. 12 - Prob. 30RQECh. 12 - In ___________ file access, the contents of the...Ch. 12 - In __________ file access, the contents of a file...Ch. 12 - The _____________ member function moves a files...Ch. 12 - The ___________ member function moves a files...Ch. 12 - The __________ member function returns a files...Ch. 12 - The ___________ member function returns a files...Ch. 12 - The __________ mode flag causes an offset to be...Ch. 12 - The __________ mode flag causes an offset to be...Ch. 12 - The ________ mode flag causes an offset to be...Ch. 12 - A negative offset causes the files read or write...Ch. 12 - Write a statement that defines a file stream...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write a program segment that defines a file stream...Ch. 12 - Write code that opens the file data.txt for both...Ch. 12 - Write code that determines the number of bytes...Ch. 12 - The infoFile file stream object is used to...Ch. 12 - T F Different operating systems have different...Ch. 12 - T F fstream objects are only capable of performing...Ch. 12 - T F ofstream objects, by default, delete the...Ch. 12 - T F ifstream objects, by default, create a file if...Ch. 12 - T F Several file access flags may be joined by...Ch. 12 - T F A file may be opened in the definition of the...Ch. 12 - T F If a file is opened in the definition of the...Ch. 12 - T F A file stream objects fail member function may...Ch. 12 - T F The same output formatting techniques used...Ch. 12 - T F The operator expects data to be delimited by...Ch. 12 - T F The getline member function can be used to...Ch. 12 - T F It is not possible to have more than one file...Ch. 12 - T F Binary files contain unformatted data, not...Ch. 12 - T F Binary is the default mode in which files are...Ch. 12 - T F The tellp member function tells a file stream...Ch. 12 - T F It is possible to open a file for both input...Ch. 12 - fstream file(ios::in | ios::out);...Ch. 12 - ofstream file; file.open (info.dat, ios::tin); if...Ch. 12 - fstream file("info.dat"); if (!file) { cout ...Ch. 12 - fstream dataFile("info.dat", ios:in | ios:binary);...Ch. 12 - Prob. 69RQECh. 12 - fstream dataFi1e("info.dat", ios:in); char...Ch. 12 - Prob. 71RQECh. 12 - fstream inFile("info.dat", ios:in); int x;...Ch. 12 - File Head Program Write a program that asks the...Ch. 12 - File Display Program Write a program that asks the...Ch. 12 - Punch Line Write a program that reads and prints a...Ch. 12 - Tail Program Write a program that asks the user...Ch. 12 - Line Numbers (This assignment could be done as a...Ch. 12 - String Search Write a program that asks the user...Ch. 12 - Sentence Filter Write a program that asks the user...Ch. 12 - Array/File Functions Write a function named...Ch. 12 - File Encryption Filter File encryption is the...Ch. 12 - File Decryption Filter Write a program that...Ch. 12 - Prob. 11PCCh. 12 - Prob. 12PCCh. 12 - Inventory Program Write a program that uses a...Ch. 12 - Inventory Screen Report Write a program that reads...Ch. 12 - Average Number of Words If you have downloaded...Ch. 12 - Customer Accounts This program should be designed...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What is the purpose of the let constructs in functional languages?
Concepts of Programming Languages (11th Edition)
Roman Numerals Write a program that prompts the user to enter a number within the range of 1 through 10. The pr...
Starting Out with Python (4th Edition)
Math Quiz Design a program that gives simple math quizzes. The program should display two random numbers that a...
Starting Out with Programming Logic and Design (4th Edition)
File Decryption Filter Design a program that decrypts the file produced by the program in Programming Exercise ...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
What is the purpose of an objects sizing handles?
Starting Out With Visual Basic (7th Edition)
Revise the method selectionSort that appears in Listing 7.10 so that is calls the method described in the previ...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Python- Write a script that uses the hashlib module to hash a user entered password and then write the hashed password to a file. Use the input function to prompt the user for the password Hash the password using the hashlib md5 function. Use utf-8 encoding. Include the new line (\n) character when you write the hashed password to the file.arrow_forwardAssume this definition: ofstream dataFile; Which of these comparisons between dataFile and cout are accurate? 1. They both use the insertion operator << 2. They both send output to some destination 3. They both use the manipulators like endl, setprecision, fixed, etc. Answers: 1, 2, and 3 Both 1 and 2 Both 1 and 3 Both 2 and 3 3 onlyarrow_forwardQ3:IN SML language how would I write a string to integer function that inputs a filename and returns zero if the contents inside the file is blank.arrow_forward
- Find an incorrect statement. Group of answer choices Type iostream is used for handling both input and output file operations Type ifstream is used for handling input file operations Type ofstream is used for handling output file operations Type fstream is used for handling both input and output file operationsarrow_forwardWhat value does the sizeof operator return for: A pointer to an integer A pointer to a double A pointer to a character string A FILE pointer Computer Language: Carrow_forwardID numbers of students receiving scholarships from the governorship and students receiving scholarships from themunicipality in a province are kept in two separate files (“governer.txt“ and “municipal.txt”). Write a program that comparesthese two files, identifies students who receive scholarships from both institutions at the same time, and saves their namesand surnames in the "common.txt" filearrow_forward
- Symbian, Android, and the iPhone all employ the same file deletion mechanism.arrow_forward/* Filename: logserver.c *//*******************************************************************************************modify this program to log the message from clients to a log file. ******************************************************************************************/#include<stdio.h>#include<sys/ipc.h>#include<sys/shm.h>#include<sys/types.h>#include<string.h>#include<errno.h>#include<stdlib.h> #define BUF_SIZE 1024#define SHM_KEY 0x1234 struct shmseg {int cnt;int new;int complete;char buf[BUF_SIZE];}; int main(int argc, char *argv[]) {int shmid;struct shmseg *shmp;shmid = shmget(SHM_KEY, sizeof(struct shmseg), 0666|IPC_CREAT);if (shmid == -1) {perror("Shared memory");return 1;}// Attach to the segment to get a pointer to it.shmp = shmat(shmid, NULL, 0);if (shmp == (void *) -1) {perror("Shared memory attach");return 1;}/* Transfer blocks of data from shared memory to log file if the message from client set shmp->complete ==1, the we…arrow_forwardA __________ file contains data that has been encoded as text, using a scheme such as Unicode. a. text b. character c. Unicode d. systemarrow_forward
- Make a distinction between file storage structure and structure storage structure.arrow_forwardThe Master file mainly contains data that is unchangeable.arrow_forward#include <iostream>#include <fstream> #include <cctype> #include <string>#include <chrono> #include "CommonName.h"#include "Name.h" using namespace std; // function prototype(s)string toUpper(string name); int main() { // constant const int SIZE = 1000; fstream inputFile; Name nameList; // cout << names[0].getName(); string name; string ranking; int nextName = 0; string searchKey; inputFile.open("CommonFemaleNames.txt", ios::in); if (!inputFile) cout << "cannot access file"; else cout << "file opened\n"; if (inputFile) { inputFile >> ranking; int ranking_num = stoi(ranking); inputFile >> name; CommonName* newName = new CommonName(ranking_num, name); nameList.addName(newName); cout << newName->getName() << " "; cout << newName->getOrdinal() << endl;…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License