1
0
This repository has been archived on 2025-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
CPP_Module_09/ex00/main.cpp
2025-07-03 14:01:38 +02:00

36 lines
1.3 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/21 10:34:50 by adjoly #+# #+# */
/* Updated: 2025/07/03 13:52:10 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include <BitcoinExchange.hpp>
#include <cstddef>
#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::exception &e) {
btc = NULL;
std::cout << e.what() << std::endl;
}
if (btc != NULL)
delete btc;
} else {
std::cout << "Error: could not open file." << std::endl;
}
}