C++ Builder 參考手冊(cè) ? System::Sysutils ? StrCopy
復(fù)制字符串
頭文件:#include <System.SysUtils.hpp>
命名空間:System::Sysutils
函數(shù)原型:
char * __fastcall StrCopy(char * Dest, const char * Source);
System::WideChar * __fastcall StrCopy(System::WideChar * Dest, const System::WideChar * Source);
參數(shù):
- Dest:把 Source 的內(nèi)容復(fù)制到 Dest 里面;
- Source:把 Source 的內(nèi)容復(fù)制到 Dest 里面;
返回值:
- 把 Source 的內(nèi)容復(fù)制到 Dest 里面 (Dest 內(nèi)容被替換),函數(shù)返回 Dest;
- Dest 字符串要有足夠的內(nèi)存儲(chǔ)存 Source 的內(nèi)容;
- 和 std::strcpy, std::_fstrcpy, std::_tcscpy, std::wcscpy 的功能相同。
例子:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
wchar_t *s = StrAlloc(1000);
StrCopy(s, Edit1->Text.c_str());
StrCat(s, Edit2->Text.c_str());
Memo1->Text = s;
StrDispose(s);
}
運(yùn)行結(jié)果:

運(yùn)行結(jié)果
相關(guān):
- System::Sysutils::StrAlloc
- System::Sysutils::StrBufSize
- System::Sysutils::StrCat
- System::Sysutils::StrComp
- System::Sysutils::StrCopy
- System::Sysutils::StrDispose
- System::Sysutils::StrECopy
- System::Sysutils::StrEnd
- System::Sysutils::StrIComp
- System::Sysutils::StrLCat
- System::Sysutils::StrLComp
- System::Sysutils::StrLCopy
- System::Sysutils::StrLen
- System::Sysutils::StrMove
- System::Sysutils::StrNew
- System::Sysutils::StrPCopy
- System::Sysutils::StrPLCopy
- System::Sysutils
- std::strcpy, std::_fstrcpy, std::_tcscpy, std::wcscpy
- <cstring>
C++ Builder 參考手冊(cè) ? System::Sysutils ? StrCopy