Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Dr. Abraham Up until now you have been declaring variables of simple (atomic) data types. Suppose you want to keep inventory of things you sell. Each item you have in stock has a name (string), a price (double), and a quantity (integer). It would be nice to keep them together and give it one name. That is what “Struct” does for us. In other languages it may be called a “Record”. We can use a class as well which is covered in the next chapter. With object oriented programming it does not make sense to use struct any more. Nevertheless.