Archives for posts tagged ‘structs’

The class string vs. C-style strings

My previous C++ post illustrated how structs worked. The same example -- reading student names and grades from a .csv file into an array of Student structs -- can be used to illustrate the differences between C-style strings -- null-terminated arrays of characters -- and the class string. The advantage of using the class string, [...]

Structs

School's out, and structs were the last thing I learned about in this C++ class I took at NC State. This semester was really about the C in C++. The object-oriented part comes in the spring. But by the time you get around to structs, you will have learned about file streaming, arrays, global constants, [...]