starting ex00
This commit is contained in:
43
ex00/main.cpp
Normal file
43
ex00/main.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user