XOBO

Don't Panic

c++ error logs

启用-Wall
帮忙解决太多bug.

alias g++='g++ -Wall'

写入配置文件

echo "alias g++='g++ -Wall'" >> ~/.bashrc && source ~/.bashrc

以下代码皆为错误代码

括号,万恶的括号!
accept 返回值是0

if ((fd = accept(Sockfd, Addr, (socklen_t*) AddrLen) < 0)) {
}

函数没有返回值!
string产生的Segmentation fault

string testString(string &a){
    a = "I'm string";
}

循环
栈溢出

char *lists[maxToken];
lists[0] = strtok(buffer, white);
int i = 1;
while ((lists[i] = strtok(NULL, white)) != NULL && i < maxToken) {
    i++;
}

Don’t Panic! From XOBO, post c++ error logs

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>