_strinc、_mbsinc、_wcsinc
string.h:インデックス への移動
ヘッダー ファイル
mbstring.h、tchar.h
カテゴリ
メモリおよび文字列操作ルーチン
プロトタイプ
unsigned char *_mbsinc(const unsigned char *p);
#define _strinc(__a) ((__a)+1)
#define _wcsinc(__a) ((__a)+1)
説明
_mbsinc は、文字列ポインタを 1 文字分増やします。 _mbsinc は MBCS 文字を認識し、次の MBCS シーケンスのリード バイトを指すポインタを返します。 _strinc マクロと _wcsinc マクロは、現在の char* ポインタまたは wchar_t* ポインタに 1 を足すだけです。
戻り値
1 文字分先のポインタを返します。
例
# include <mbstring.h>
# include <iostream>
using namespace std;
int main()
{
unsigned char str[] = "012345";
cout << "str: " << str << endl;
unsigned char *result;
result = _mbsinc(str);
cout << "The string from from next byte is: " << result << endl;
//出力: "The string from from next byte is: 12345"
return (0);
}