Q&A

Q1:What happens if I write to element 25 in a 24-member array?
A1: You will write to other memory, with potentially disastrous effects on your program.
Q2:What is in an uninitialized array element?
A2: An array element that has not been assigned a value. The value is whatever happens to be in memory at a given time. The results of using this member without assigning a value are unpredictable.
Q3:Can I combine arrays?
A3: Yes. With simple arrays you can use pointers to combine them into a new, larger array. With strings you can use some of the built-in functions, such as strcat, to combine strings.

Get Sams Teach Yourself C++ in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.