That is because name[10] does not exist, the array only consists of elements 0-9. Try this...
Code:#include <iostream> using namespace std; int main() { char name[10]; cin.getline(name, 11); cout<<name; cout << name[9]; return 0; }
That is because name[10] does not exist, the array only consists of elements 0-9. Try this...
Code:#include <iostream> using namespace std; int main() { char name[10]; cin.getline(name, 11); cout<<name; cout << name[9]; return 0; }
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.
dang... i cant believe i forgot something so fundamental.
I guess i shouldnt rush things, no matter how simple they appear to be...
Thanks
I AM WINNER!!!1!111oneoneomne