-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I will come back to rewrite the code in a cleaner way.
- Loading branch information
Showing
14 changed files
with
144 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include <iostream> | ||
#include <Array.hpp> | ||
|
||
#define MAX_VAL 750 | ||
int main(int, char**) | ||
{ | ||
Array<int> numbers(MAX_VAL); | ||
int* mirror = new int[MAX_VAL]; | ||
srand(time(NULL)); | ||
for (int i = 0; i < MAX_VAL; i++) | ||
{ | ||
const int value = rand(); | ||
numbers[i] = value; | ||
mirror[i] = value; | ||
} | ||
//SCOPE | ||
{ | ||
Array<int> tmp = numbers; | ||
Array<int> test(tmp); | ||
} | ||
|
||
for (int i = 0; i < MAX_VAL; i++) | ||
{ | ||
if (mirror[i] != numbers[i]) | ||
{ | ||
std::cerr << "didn't save the same value!!" << std::endl; | ||
return 1; | ||
} | ||
} | ||
try | ||
{ | ||
numbers[-2] = 0; | ||
} | ||
catch(const std::exception& e) | ||
{ | ||
std::cerr << e.what() << '\n'; | ||
} | ||
try | ||
{ | ||
numbers[MAX_VAL] = 0; | ||
} | ||
catch(const std::exception& e) | ||
{ | ||
std::cerr << e.what() << '\n'; | ||
} | ||
|
||
for (int i = 0; i < MAX_VAL; i++) | ||
{ | ||
numbers[i] = rand(); | ||
} | ||
delete [] mirror;// | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* main.cpp :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: asepulve <asepulve@student.42.fr> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/03/06 12:39:54 by asepulve #+# #+# */ | ||
/* Updated: 2024/03/27 12:15:43 by asepulve ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include <BitcoinExchange.hpp> | ||
#include <iostream> | ||
#include <string> | ||
#include <fstream> | ||
|
||
/*map*/ | ||
int main(int argc, char **argv) | ||
{ | ||
std::ifstream pricesFile; | ||
std::ifstream bitcoinFile; | ||
|
||
BitcoinExchange bitcoinExchange; | ||
|
||
if (argc == 2 && argv[1]) | ||
{ | ||
pricesFile.open(argv[1]); | ||
bitcoinFile.open("./data.csv"); | ||
} | ||
if (argc != 2 || !pricesFile.is_open() || !bitcoinFile.is_open()) | ||
{ | ||
std::cerr << "Error: could not open file." << std::endl; | ||
return (1); | ||
} | ||
bitcoinExchange.setBitcoin(bitcoinFile); | ||
bitcoinExchange.valueTimesExchangeRate(pricesFile); | ||
return (0); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.