数据结构
#include<iostream> using namespace std; struct books{ char name[10]; int num; float price; }book; int main() { book.num=1; book.price=2.5; char x[10]="Hello",n; for(n=0;n<10;n++) book.name[n]=x[n]; cout << book.name <<endl; cout << book.num <<endl; cout << book.price <<endl; return 0; }