C uses a convenient abstraction called streams to perform input and output operations in sequential media such as the screen, the keyboard or a file. A stream is an entity where a program can either insert or extract characters to/from. There is no need to know details about the media associated to the stream or any of its internal specifications. C comes with libraries which provides us many ways for performing input and output. In C input and output is performed in the form of sequence of bytes or more commonly known as streams. Input Stream: If the direction of flow of bytes is from device(for example: Keyboard) to the main memory then this process is called input. Manipulators are helper functions that make it possible to control input/output streams using operator. (since C20) The manipulators that are invoked with arguments (e.g. Controls whether leading whitespace is skipped on input (function). When you say 'but the first index in array is the file path and the file contents is not displayed.' It sounds like you're trying to read input from argv and argc. The angle bracket shell operator does not work that way. Instead, stdin (what cin and several C functions read from) has the contents of that file. Aug 27, 2011 Concepts - Use of cin & cout for input & output - Use of variables - Use of string data type. Concepts - Use of cin & cout for input & output - Use of variables - Use of string data type.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |