fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
30
docs/api/containers/array/data.md
Normal file
30
docs/api/containers/array/data.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Array::Data()
|
||||
|
||||
```cpp
|
||||
T* Data();
|
||||
const T* Data() const;
|
||||
```
|
||||
|
||||
获取指向底层数组数据的原始指针。
|
||||
|
||||
**用途:** 用于与 C 风格 API 或需要直接访问内存的场景(如与 GPU 通信)。
|
||||
|
||||
**返回:** 指向底层连续内存块的指针。如果数组为空,返回 `nullptr`。
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Containers::Array<float> arr = {1.0f, 2.0f, 3.0f};
|
||||
|
||||
float* raw = arr.Data();
|
||||
size_t count = arr.Size();
|
||||
|
||||
// 可用于与 C API 交互
|
||||
// memcpy(dst, arr.Data(), arr.Size() * sizeof(float));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Array 总览](array.md) - 返回类总览
|
||||
Reference in New Issue
Block a user