分享方式:


__stosb

Microsoft 特定的

產生存放區字串指令 ( rep stosb )。

語法

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

參數

目的地
[out]作業的目的地。

Data
[in]要儲存的資料。

Count
[in]要寫入的位元組區塊長度。

需求

內建 架構
__stosb x86、x64

標頭檔 < intrin.h>

備註

結果是資料字元 會寫入目的地 字串中的 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);

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

END Microsoft 特定的

另請參閱

編譯器內建函式