#12 Jerry, ERRATA
pardon, chybička se vloudila :)
// Win32Project1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char setOfChars[255];
bool countValueExists;
int count;
std::ifstream ifs;
ifs.open("c:\\Mracno.pts", std::ifstream::in);
ifs.getline(setOfChars,255);
string line(setOfChars);
line.erase(0, line.find_first_not_of(' '));
line.erase(line.find_last_not_of(' ') + 1);
if ( line.find_first_not_of("0123456789") == string::npos ) {
countValueExists = true;
count = atoi(setOfChars);
} else
{
countValueExists = false;
count = -1;
}// if else
ifs.close();
std::cout << "nacteny retezec znaku: " << setOfChars;
std::cout << "\n";
std::cout << "je pocet radku platne cislo: " << countValueExists;
std::cout << "\n";
std::cout << "pocet radku: " << count;
std::cout << "\n";
std::cout << "funkce atoi: " << atoi(setOfChars);
std::cout << "\n";
return 0;
}