这个问题是有与和系统变量重名导致的,如 char* ans = (char*) malloc(10);系统变量是一个int。 转载于:https://www.cnblogs.com/ele-oy/p/4891113.html