📄 card.cpp
字号:
// Card.cpp: implementation of the Card class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Card.h"
#include <string.h>
#include <iostream.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Card::Card( char* t, char* name, int num )
{
cout << "sizeof(title) is " << sizeof(title) << endl;
cout << "sizeof(*title) is " << sizeof(*title) << endl;
strncpy( title, t, sizeof( title ) );
title[ sizeof(title)/sizeof(*title) - 1 ] = '\0';
strncpy( author, name, sizeof( author ) );
author[ sizeof(author)/sizeof(*author) -1 ] = '\0';
number = num;
}
void Card::Show()
{
cout << "\nTitle:" << title << endl;
cout << "Author:" << author << endl;
cout << "Number on hand:" << number << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -