If I have char array[6] and my input, ABC is stored in the array, what would be the next element after ABC in the array? I tried experimenting but the result doesn't make sense.
This is a discussion on Simple array question within the C++ Programming forums, part of the General Programming Boards category; If I have char array[6] and my input, ABC is stored in the array, what would be the next element ...
If I have char array[6] and my input, ABC is stored in the array, what would be the next element after ABC in the array? I tried experimenting but the result doesn't make sense.
You should have "ABC" followed by a \0, and then 2 bytes of junk (could be anything).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Got it, thanks!