Skip to content

08_StringtoInteger.cpp #5

Description

@shuangliyue

39行,应该加上括号,要不然如输入"2147483646"时会先计算 2147483640 + 54造成overflow, num = num * 10 + (str[i] - '0');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions