Skip to content

Commit

Permalink
Added a copy constructor (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
biancama authored and kasparsklavins committed Jun 16, 2016
1 parent 68e8f9e commit 1b840c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
build
build
.idea
6 changes: 5 additions & 1 deletion src/bigint.cpp
Expand Up @@ -13,7 +13,11 @@ Bigint::Bigint()
base = 1000000000;
skip = 0;
}

Bigint::Bigint(const Bigint &b)
: number(b.number),
positive(b.positive),
base(b.base),
skip(b.skip) { }
Bigint::Bigint(long long value)
{
base = 1000000000;
Expand Down
1 change: 1 addition & 0 deletions src/bigint.h
Expand Up @@ -20,6 +20,7 @@ class Bigint
Bigint();
Bigint(long long);
Bigint(std::string);
Bigint(const Bigint& b);

//Adding
Bigint operator+(Bigint const &) const;
Expand Down

0 comments on commit 1b840c7

Please sign in to comment.