帮我解决-将数字20添加到“总计”列的每一行中-屏幕https://i.stack.imgur.com/0OOye.png
for (i = 0; i < strlen(s)/2; i++)
{
bytearray[i] = AsciiToHex(s[2*i])<<4 | AsciiToHex(s[2*i+1]);
printf("bytearray %d: %02X\n", i, bytearray[i]);
}
uint8_t AsciiToHex(char c){
if (c >= '0' && c<='9') return c - '0';
else if (c >= 'A' && c <= 'F') return 10 + c - 'A';
else return 0;
}
答案 0 :(得分:1)
如果加法是指数学加法,请使用以下方法:
for (int itt = 1; itt < listView1.Items.Count; itt++)
{
int Totall = 20;
listView1.Items[itt].SubItems["Total"].Text = (int.Parse(listView1.Items[itt].SubItems["Total"].Text) + Totall).ToString();
}
如果您只想在行尾添加“ 20”,请使用以下代码:
for (int itt = 1; itt < listView1.Items.Count; itt++)
{
int Totall = 20;
listView1.Items[itt].SubItems["Total"].Text = listView1.Items[itt].SubItems["Total"].Text + Totall;
}