Sign in to follow this  

easy char qt

Recommended Posts

sorry, it should have been:
char *str = "Hello";
str[0] = str[1];
// something along those lines...
// whenever I assign an individual character from
// str to another character, the program crashes
cout << str[0] << endl; // program crashes!

This seems like the most basic thing you could possibly do, yet it crashes! What's wrong with it?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this