📄 strtype.cpp
字号:
// StrType.cpp: implementation of the StrType class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "StrType.h"
#include <string.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
StrType::StrType()
{
*s = '\0';
}
StrType::StrType( char* p)
{
strcpy( s, p );
}
StrType::~StrType()
{
}
StrType StrType::operator+( StrType& s2 )
{
StrType t;
strcpy( t.s, s );
strcat( t.s, s2.s );
return t;
}
StrType& StrType::operator =( StrType& s2 )
{
strcpy( s, s2.s );
return *this;
}
int StrType::operator <( StrType& s2 )
{
return strcmp( s, s2.s ) < 0;
}
int StrType::operator >( StrType& s2 )
{
return strcmp( s, s2.s ) > 0;
}
int StrType::operator ==( StrType& s2 )
{
return strcmp( s, s2.s ) == 0;
}
char* StrType::Get()
{
return s;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -