📄 strtype.cpp
字号:
// StrType.cpp: implementation of the StrType class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "StrType.h"
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
StrType::StrType( char* ptr )
{
len = strlen( ptr );
p = new char[ len + 1 ];
if ( !p )
{
cout << "Allocation error\n";
exit(1);
}
}
StrType::~StrType()
{
cout << "Freeing p\n";
delete[] p;
}
void StrType::Show()
{
cout << p << "length:" << len;
cout << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -