Base 64解码在C中返回NULL

时间:2016-10-05 16:01:01

标签: c base64 decode glib

我有一个基本64位编码的字符串,我想要解码。 它看起来像这样:

VGhpcyBpcyBhIGZpbGUgdGhhdCBJIHdhbnQgdG8gZGVjb2Rl

当我这样做..

gsize *out_len;
unsigned const char *decoded;
decoded = g_base_64_decode(myString, out_len);

并打印出我的解码字符串,我也得到NULL,我得到断言: 来自Glib的'out_len!= NULL'失败

为什么会这样?如何使用此功能正确解码我的字符串? https://developer.gnome.org/glib/stable/glib-Base64-Encoding.html#g-base64-decode-step

1 个答案:

答案 0 :(得分:2)

from openpyxl import load_workbook excel_file = load_workbook(excel_file_path,read_only=True) sheet = excel_file["Sheet1"] mylist = [] row_num = sheet.max_row for row_index in range(1,row_num): for cell in sheet[row_index]: mylist.append((cell.value, cell.row, cell.column)) 参数是输出参数。这意味着您通常会在堆栈上创建类型为out_len的{​​{1}}变量,如下所示:

out_len

然后你调用函数将指针传递给前面提到的变量(即你传递它的地址:gsize),例如:

gsize out_len;