Skip to content
Permalink
50a8e40fec
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
31 lines (26 sloc) 481 Bytes
#include "input.h"
#include <iostream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <memory>
int task()
{
int size = 0;
// get the size
while( size <= 0 )
{
std::cout << "Enter a size: ";
try
{
size = input<int>(); // using my function for getting input
}
catch( std::runtime_error &e )
{
std::cerr << "Not an integer" << std::endl;
}
}
std::cout << "Reading in " << size << " values." << std::endl;
// COMPLETE ME
return 0;
}