Skip to content
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

Update ReplaceSpaces.cpp for array bounds #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update ReplaceSpaces.cpp for array bounds #3

wants to merge 3 commits into from

Conversation

wylloong
Copy link

if((newLength+1) > length)
return;
因为字符串末尾以'\0'结尾,所以newLength+1才是真实的字符数组长度。

wylloong added 3 commits July 23, 2017 13:11
if((newLength+1) > length)
        return;
因为字符串末尾以'\0'结尾,所以newLength+1才是真实的字符数组长度
I am trying to compile this C++ program in Ubuntu 16.4, but I am getting this error:
error: ‘memset’ was not declared in this scope.
So, I think you should include <string.h> (or its C++ equivalent, <cstring>).
int/int is int ,not a float.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant