tipplektionen/main.cpp
2023-03-08 21:16:15 +01:00

36 lines
No EOL
847 B
C++

#include <fstream>
#include <iostream>
#include <string>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
int main(int argc, char *argv[])
{
std::string letters;
po::options_description desc("Erlaubte Optionen");
desc.add_options()("help,h", "Ausgabe der Hilfe")("letters,l", po::value<std::string>(&letters),
"Enthaltene Buchstaben");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help")) {
std::cout << desc << std::endl;
return 1;
}
std::ifstream infile("../wortliste.txt");
std::string line;
long counter{0};
while (std::getline(infile, line)) {
counter++;
}
std::cout << "Anzahl: " << counter << std::endl;
}