answersLogoWhite

0

#include<iostream> #include<vector>

int main()

{

std::vector<int> integers (12);

for (size_t loop=0; loop<integers.size(); ++loop)

cin >> integers[loop];

}

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

C plus plus reading and writing a file?

Use an input file stream (ifstream) to read from a file and an output file stream (ofstream) to write to a file. Both can be found in the &lt;fstream&gt; standard library header.


What is iosteram in c plus plus?

The &lt;iostream&gt; include file is a header file that contains the prototype declarations of functions that provide the basic input/output mechanisms in C++. The &lt;iostream&gt; header file sets up the objects that initialize the basic input/output pathways, cout and cin.


What are file modes in c plus plus?

I guess you mean either input/output/inout/append or binary/text.


What are filestream classes in c plus plus?

The file stream classes (ifstream and ofstream) are derivatives of the I/O stream classes (istream and ostream) that are specific to file input and output.


C plus plus code to read the data from any file?

The following function will read any valid file name one byte at a time. int read_file(char* filename) { FILE* input=fopen( filename,"rb" ); if( !input ) { std::cerr&lt;&lt;"File access error: "&lt;&lt;filename&lt;&lt;std::endl; return( -1 ); } char ch; while( fread( &amp;ch, 1, 1, input )==1 ) { // process the byte... } fclose( input ); return( 0 ); }


Is it possible to write a C plus plus or java program to draw an activity flow diagram given the sequence as a text file input and store the diagram in an output file?

Yes, this is possible.


Does a c plus plus stream is a file yes or no?

Yes, at least as far as C++ is concerned. Although you wouldn't regard the keyboard as being a file, to C++ there is no difference between accepting input from a disk-based file or from the keyboard: they are both streams and therefore they are both files. The same logic applies to the console window or a printer with regards output streams. However, it's probably easier to think of a file stream as being an abstraction. The user can redirect input and output from the command line as they see fit, so the same code will operate regardless of where the input or output is physically directed. Thus a file stream can be regarded as being a conceptual file rather than an actual disk-based file.


How do you alternate the input numbers using for loop in c plus plus?

Input a variable.


What is file handling in c and c plus plus or objective c?

File handling is simply the process of opening, reading, writing and closing files. Files are simply streams for input and output, or the "serialisation" of objects. In other words, reading and writing data to and from disk storage.


How is file handling applied in c plus plus?

File handling is handled by input stream objects (ifstream) and output stream objects (ofstream), or bi-directional streams (fstream). These classes are derived from istream and ostream. See related links for more information on these classes.


What is the header for basic input or output in C Plus Plus?

For basic input and output in C++: #include


Do you put a plus sign on positive integers?

no