We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s
Exercise 3.9
What does the following program do? Is it valid? If not, why not?
string s; cout << s[0] << endl;
Maybe should mention string s is empty string.
Try to get the first element of the string. It is invalid, cause this is undefined behavior.
Try to get the first element of the empty string s (default initialization). It is invalid, cause this is undefined behavior.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Exercise information
Exercise 3.9
Question or Bug
Maybe should mention string s is empty string.
Answer was
Answer modified
The text was updated successfully, but these errors were encountered: