Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix issue#45: add integer overflow checking #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions C++/chapImplement.tex
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ \subsubsection{代码}

for (; x; x /= 10)
r = r * 10 + x % 10;

return r;
if (abs(r) > (pow(2, 31) - 1)) {
return 0;
} else {
return r;
}
}
};
\end{Code}
Expand Down
2 changes: 1 addition & 1 deletion C++/chapTrick.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ \subsubsection{vector和string优先于动态分配的数组}

首先,在性能上,由于\fn{vector}能够保证连续内存,因此一旦分配了后,它的性能跟原始数组相当;

其次,如果用new,意味着你要确保后面进行了delete,一旦忘记了,就会出现BUG,且这样需要都写一行delete,代码不够短;
其次,如果用new,意味着你要确保后面进行了delete,一旦忘记了,就会出现BUG,且这样需要多写一行delete,代码不够短;

再次,声明多维数组的话,只能一个一个new,例如:
\begin{Code}
Expand Down