[C++]这个函数如何调用

2019-08-12 00:04:08 +08:00
 AX5N
int WINAPI Decompress(
  char * pbOutBuffer,
  int * pcbOutBuffer,
  char * pbInBuffer,
  int cbInBuffer
);



pbOutBuffer
    [out] Pointer to buffer where the decompressed data will be stored.
    
pcbOutBuffer
    [in, out] On call, pointer to the length of the buffer in pbOutBuffer. When finished, this variable receives length of the decompressed data.
    
pbInBuffer
    [in] Pointer to data that are to be exploded.
    
cbInBuffer
    [in] Length of the data pointed by pbInBuffer. 

第一第三大概指的是写入和读取的缓存位置,第四个应该是读取缓存的大小,但第二个不太懂。 最好写一个例子

800 次点击
所在节点    程序员
4 条回复
ysc3839
2019-08-12 00:11:38 +08:00
调用前先设置成 `pbOutBuffer` 的长度,调用后会被设置成实际数据的长度。
v2byy
2019-08-12 00:13:30 +08:00
就是一个 in out 参数啊,入参表示第一个参数长度,同时函数返回表示第三个参数的长度,都写在注释里啊
AX5N
2019-08-12 00:24:52 +08:00
@ysc3839
@v2byy
谢谢,好像工作了...虽然结果和我想象的有点不同,我再看看。
AX5N
2019-08-12 00:32:38 +08:00
@ysc3839
@v2byy 再感谢次,已经成功了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/591033

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX