これは私が数年前には些細なことだと思っていたものです...私はCやC++で手を振っていて、今は片頭痛を引き起こしている問題があります。一緒に文字配列を連結する
私は次のコードのエラー受け付けております:
CompressFile::CompressFile(wchar_t *WorkingDirectory, wchar_t *File)
{
int bzipError = BZ_OK;
wprintf(L"Attempting to compress %s%s\n", WorkingDirectory, File);
wchar_t FileRawInput[MAX_PATH];
wcsncpy(FileRawInput, WorkingDirectory, sizeof(FileRawInput));
wcsncat(FileRawInput, File, sizeof(FileRawInput));
wchar_t bzipCompressedOutput[MAX_PATH];
wcsncpy(bzipCompressedOutput, FileRawInput, sizeof(bzipCompressedOutput));
wcscat(bzipCompressedOutput, L".bz2");
wprintf(L"Output of string bzip: %s\n", bzipCompressedOutput);
wprintf(L"Output of string raw: %s\n", FileRawInput);
}
私は8行目で、この次のエラーを受けています:私はすでに使用して回避するために、距離を行ってきた
Unhandled exception at 0x64F4C6D1 in ias-agent.exe: 0xC00001A5: An invalid exception handler routine has been detected (parameters: 0x00000003).
をクラスであり、当面はそれをそのまま維持したいと考えています。私がしようとしているのは、RawFileInput
のために2つの文字列を一緒に追加してからRawFileInput
の値をbzipCompressionOutput
に追加し、最後にを末尾にbzipCompressionOutput
に連結します。 last page of chapter 4 in his bookで
あなたは 'のstd :: wstring'を避けたいのはなぜ? – NathanOliver
C++の使用を避けたい場合は、常にこの質問にC – KABoissonneault
というタグを付けることができます。変更可能な 'wchar'バッファが必要な場合は' std :: vector'を使い、それ以外の場合は 'std :: wstring'を使います。このCスタイルの文字列ビジネスは貴重な時間を無駄にしています。 (重要な利点を証明することができない限り、これはそうではないと思われます。) –