ex00 edge cases and execute function
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user