3 ms·
Sure you can do that, but strcspn only found the newline, it didn't delete it. After all, you can also do foo[strlen(foo)-1] = 0; But I don't think anyone wo
by marvy 11y ago
Sure you can do that, but strcspn only found the newline, it didn't delete it. After all, you can also do
foo[strlen(foo)-1] = 0;
But I don't think anyone would say strlen modifies the string.