Skip to content

C++ 栈空间不足 端上崩溃。 #196

@bringtree

Description

@bringtree

在端上使用大数组 如果直接用
char a[999999]; 会由于栈空间不足失败, 但是不会抛出错误
直到memset 初始化数组的时候 这时候就会段错误。

需要改用new在堆上申请空间申请, 记得delete释放空间.
char* a = new char(999999)

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