33 lines
1.3 KiB
C++
33 lines
1.3 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/05/21 10:34:50 by adjoly #+# #+# */
|
|
/* Updated: 2025/06/03 11:31:50 by adjoly ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <BitcoinExchange.hpp>
|
|
#include <cstdlib>
|
|
#include <exception>
|
|
#include <stdexcept>
|
|
|
|
int main(int ac, char **av) {
|
|
(void)av;
|
|
if (ac > 1) {
|
|
BitcoinExchange *btc;
|
|
try {
|
|
btc = new BitcoinExchange(av[1]);
|
|
btc->print();
|
|
} catch (std::runtime_error &e) {
|
|
std::cout << e.what() << std::endl;
|
|
}
|
|
delete btc;
|
|
} else {
|
|
std::cout << "Error: could not open file." << std::endl;
|
|
}
|
|
}
|