char s[]= "/home"; opendir(s); char s1[] = " /home" char *p = s + 2; opendir(p); 都没有错误。 转载于:https://www.cnblogs.com/ccccccccc/p/3228660.html