Visual C ++ programming course by Paul Elias
Author:Paul, Elias [Paul, Elias]
Language: eng
Format: epub
Published: 2020-06-19T16:00:00+00:00
Introduction
Almost all high-level languages have standard libraries of functions for manage data input / output, both for keyboard / screen and files. C ++ does not uses this strategy, that is, it does not define a function library, but rather defines a class library that can be expanded and improved if the application requires it.
The idea is that the input and output operations are applied to objects of some classes determined, using operator overload as a method to indicate the form of enter and extract data to or from I / O to our program.
The way of working with I / O makes it possible to check input and output types, that we have a uniform way of reading and writing variables of all types (including classes) and even that we can treat in a similar way the input output for different devices.
The fundamental concept in C ++ for dealing with input / output is the notion of stream that is can translate as flow or stream. The idea is that there is a flow of data between our program and the exterior, and the streams are in charge of transporting the information, will be as a channel through which we send and receive information.
C ++ defines streams to manage keyboard and display I / O (standard input and output), the File I / O and even character string I / O management.
First we will study the I / O between us and the machine (keyboard and screen) and then we will see the file and chain management. We'll talk about simple input and output first, and then We will discuss the formatting possibilities and the use of I / O handlers.
Stream objects
C ++ defines (by including the header ) a series of stream classes , the most They are important istream , ostream and iostream defining streams input, output and input / output respectively. In addition to defining the classes, in this header a series of standard objects that will be the ones we will use most frequently: cin Object that receives input by keyboard, belongs to the istream class cout Object that generates the screen output, belongs to ostream cerr Object for error output, is an ostream that initially outputs its messages per screen, although you can redirect.
clog Same as cerr , but manages buffers differently
Input and output
At this point we will describe the ios class, which is the class used to define objects of type stream to handle I / O. First we will see the class description and then we will see that things we can use to know the status of the stream, the I / O formatting possibilities and a list of special Streaming access features.
The ios class
class ios {
ostream * tie (ostream * s); // Link two streams
// we can link input with output
76
Page 83
ostream * tie ();
int width (int w);
// Set the field length
int width () const;
// Returns the length
char fill (char);
// Set padding character
char fill () const;
// Returns padding character
long flags
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12568)
Hello! Python by Anthony Briggs(9912)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Dependency Injection in .NET by Mark Seemann(9336)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8293)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7760)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7043)
Microservices with Go by Alexander Shuiskov(6808)
Practical Design Patterns for Java Developers by Miroslav Wengner(6720)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6660)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Angular Projects - Third Edition by Aristeidis Bampakos(6068)
The Art of Crafting User Stories by The Art of Crafting User Stories(5597)
NetSuite for Consultants - Second Edition by Peter Ries(5534)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5337)
Kotlin in Action by Dmitry Jemerov(5062)
