#include<stdio.h>
#include<ctype.h>
int main() {
char* start = "There are no";
char* d = start;
char* s = d;
while (s) {
char c = *s++;
if (ispunct(c) || isspace(c)) {
continue;
}
*d++ = c;
}
printf("%s\n", start);
}
私は c/c++ が初めてで、文字列を操作する方法を理解しようとしています。上記のコードは、文字列をスキャンして句読点とスペースをスキップし、句読点とスペースなしで文字列を出力します。
実行中に「バスエラー:10」が表示されます
私は何を間違っていますか?