答案
#include<iostream>
using namespace std;
#include<string>//string类
#include<string.h>//memcpy头文件
long long MAXSIZE = 1000;
struct BOOK {
string ISBN;
string name;
float price;
};
void reverse(BOOK book[],int length) {//数组作形参
for (int i = 0; i < length / 2; i++) {
BOOK temp;
temp = book[i]; book[i] = book[length - i - 1]; book[length - i - 1] = temp;
}
}
int main() {
cin >> MAXSIZE;
BOOK* book = new BOOK[MAXSIZE];
int currentPos = 0;//当前书的信息数,也就是下一个空数组的下标
for (int i = 0; i < MAXSIZE; i++) {
cin >> book[i].ISBN >> book[i].name >> book[i].price;
}
int length = 0;
//book被当成指针类型的变量了,64位机里,值为8
//length = sizeof(book) / sizeof(BOOK);
length = MAXSIZE