_strinc, _mbsinc, _wcsinc
Remonter à String.h - Index
Header File
mbstring.h, tchar.h
Category
Memory and String Manipulation Routines
Prototype
unsigned char *_mbsinc(const unsigned char *p);
#define _strinc(__a) ((__a)+1)
#define _wcsinc(__a) ((__a)+1)
Description
_mbsinc increments a string pointer by one character. _mbsinc recognizes MBCS characters and returns the pointer to the leadbyte in the next MBCS sequence. _strinc and _wcsinc macros simply add 1 to the current char* or wchar_t* pointer.
Return Value
Returns a pointer that is incremented by one character.
Example
#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;
//output: "The string from next byte is: 12345"
return (0);
}