I don't think '\0' is null.
it is not what I meant about null, at the begging the first if is always true. And length is always positive and bigger than 0 because of the same if. it just doesn't allow me to change the string
You are passing a string literal to your function and you can't change them. Try passing an array of characters instead. You could also create a new char* string within your function using malloc and then copy the passed in string to this array and manipulate them
Обсуждают сегодня