You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default char * array in C works fine, but its prone to errors. Since it does not keep track of the length of the string, buffer overflows and other security vulnerabilities are common. Modern computers have enough memory to store the length of the char * with the string. This would make it easier, and more safe, to use. If we were to implement a string type we would make sure it can be compatible with all the builtin str functions. We could also just make some of our owns.
The text was updated successfully, but these errors were encountered:
One advantage is that the type could be mutable: it dynamically changes its size on demand. We could also make an immutable string. That has its uses as well.
The default char * array in C works fine, but its prone to errors. Since it does not keep track of the length of the string, buffer overflows and other security vulnerabilities are common. Modern computers have enough memory to store the length of the char * with the string. This would make it easier, and more safe, to use. If we were to implement a string type we would make sure it can be compatible with all the builtin str functions. We could also just make some of our owns.
The text was updated successfully, but these errors were encountered: