starting ex00

This commit is contained in:
aortigos
2026-04-23 21:05:36 +02:00
commit 7afb0335ef
8 changed files with 1807 additions and 0 deletions

43
ex00/main.cpp Normal file
View File

@@ -0,0 +1,43 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/23 19:58:34 by aortigos #+# #+# */
/* Updated: 2026/04/23 20:48:10 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "BitcoinExchange/BitcoinExchange.hpp"
int main(int argc, char **argv)
{
if (argc != 2)
{
cout << "Usage: ./btc <database>" << endl;
return (0);
}
std::ifstream inFile(argv[1]);
if (!inFile)
{
cout << "Error: could not open database." << endl;
return (1);
}
BitcoinExchange bc;
try {
bc.readDatabase(inFile);
} catch (std::exception &e)
{
std::cout << e.what() << std::endl;
}
return (0);
}