1
0
mirror of synced 2026-03-01 00:07:56 +08:00

docs: highlight code blocks C readme.md

This commit is contained in:
AuroraTea
2022-12-17 22:27:34 +08:00
parent e44b649522
commit b394f90ed2

View File

@@ -6,11 +6,10 @@
2.如果是 Windows 环境,要用 Cygwin 或 MinGW。
## 调用示例C
第1步**全局** 初始化(应用程序启动时执行一次):
```
```c
// 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId
IdGeneratorOptions options = BuildIdGenOptions(Your_Unique_Worker_Id);
// options.WorkerIdBitLength = 10; // 默认值6限定 WorkerId 最大值为2^6-1即默认最多支持64个节点。
@@ -25,8 +24,7 @@ SetIdGenerator(options);
```
第2步生成ID
```
```c
// 初始化后在任何需要生成ID的地方调用以下方法
long newId = NextId();
```
```