ex00 edge cases and execute function

This commit is contained in:
2026-04-24 01:20:07 +02:00
parent 7afb0335ef
commit c28623442e
7 changed files with 132 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
/* 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 */
/* Updated: 2026/04/24 00:32:28 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,18 +21,21 @@ int main(int argc, char **argv)
return (0);
}
std::ifstream inFile(argv[1]);
std::ifstream database("data.csv");
std::ifstream inputFile(argv[1]);
if (!inFile)
if (!database || !inputFile)
{
cout << "Error: could not open database." << endl;
cout << "Error: could not open file." << endl;
return (1);
}
BitcoinExchange bc;
try {
bc.readDatabase(inFile);
bc.readDatabase(database);
bc.execute(inputFile);
} catch (std::exception &e)
{
std::cout << e.what() << std::endl;