29

#include <iostream>
#include <cstring>

using namespace std;

struct books{
char name[50];
char author[50];
};

void printBook( struct books *book ) {
cout << "name: " << book->name <<endl;
cout << "author: " << book->author <<endl;
}

int main(int argc, char *argv[])
{
books book1;
strcpy(book1.name, "C++ programing teaching");
strcpy(book1.author, "professor tz");
printBook(&book1);
return 0;
}

posted on 2017-03-29 16:14  tuzhuo  阅读(58)  评论(0编辑  收藏  举报