PB上手(7) 陣列失敗

2021-09-27 06:03:58 字數 975 閱讀 2789

typedef struct _smartpassproto_tsliotdispatchrainbowlistrequest  smartpassproto_tsliotdispatchrainbowlistrequest;

結構體包含乙個陣列

//初始值

smartpassproto_tsliotdispatchrainbowlistrequest response = smartpassproto_tsliotdispatchrainbowlistrequest_init_zero;

//準備解析

pb_istream_t input = pb_istream_from_buffer(pst->data,pst->len);

//單獨寫乙個解析函式

response.list.funcs.decode = &rainbow_decode_callback;

if (!pb_decode(&input , smartpassproto_tsliotdispatchrainbowlistrequest_fields, &response))

log(debug,"rainbow 住戶表更新時間戳:%d\n" , response.update_time);

問題的關鍵來了!重寫了函式response.list.funcs.decode在這個函式裡面

需要明確是什麼樣子的陣列!別人並不知道你就是u8型別的!!

也就是typedef struct _******message ******message;

不能體現 pb_callback_t days; 重新來過!

開始吧再來一次

syntax = "proto2";

message ******message

message arryint

發現測試也不行 懷疑是陣列mian的時候 轉變成流的函式不對 不能用字串那個函式

問題在new10表達

PB 資料儲存失敗

row changed between retrieve and update.no changes made to database.這個問題產生原因之一,由於pb資料窗字段與資料庫字段格式不匹配 q 如 sfz id 字元型15位,現在改為18位 而pb資料窗如果沒有重新對sql進行編輯是不會更...

Angular7上手體驗

檢視當前你的node版本可以在cmd中輸入 開發工具強烈推薦 用cli命令建立 ng7demo 這裡前面我用ng7 demo的時候報錯 應該是不能用下劃線 這裡誇獎下,7加入了cli prompts 建立的時候可以選是否啟用router 及 css用scss,sass等 暫時只有這2個prompts...

go「生猛」上手 陣列快排

先上 如下 package main import fmt func qsort array int left int right int base array left i left j right for i j 先看右邊,當右邊的數比基準大時,依次往左遞減 for array i base i...