Share via


__stosb

Microsoft 专用

生成存储字符串指令 (rep stosb)。

语法

void __stosb(
   unsigned char* Destination,
   unsigned char Data,
   size_t Count
);

参数

目标
[out] 操作的目标。

数据
[in] 要存储的数据。

计数
[in] 要写入的字节块的长度。

要求

Intrinsic 体系结构
__stosb x86、x64

头文件<intrin.h>

备注

结果是将字符“Data”写入到“Destination”字符串中“Count”字节块

此例程仅可用作内部函数。

示例

// stosb.c
// processor: x86, x64
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__stosb)

int main()
{
    unsigned char c = 0x40; /* '@' character */
    unsigned char s[] = "*********************************";

    printf_s("%s\n", s);
    __stosb((unsigned char*)s+1, c, 6);
    printf_s("%s\n", s);

}
*********************************
*@@@@@@**************************

结束 Microsoft 专用

另请参阅

编译器内部函数