小编AQU*_*AQU的帖子

如何挑选从一个文件到另一个文件的更改?

我有两个文件调用vvn.c,aqu.c 我做了更改vvn.c,我有我的git提交.如何樱桃选择相同的变化aqu.c 唯一的区别是API.

vvn.c 包含API作为 vvn_function_names()

aqu.c包含API的unions_function_names()

我不知道该怎么做.我知道樱桃采摘到同一个文件.有没有办法做到这一点?

git cherry-pick git-cherry-pick

7
推荐指数
1
解决办法
3590
查看次数

为什么在Java中左移以更改符号值

我正在使用Java。我想知道为什么Java会产生此输出。我在这里分享代码。

public class vvn {

    public static void main(String[] args)
    {
        byte [] arr = new byte[4];
        arr[0] = (byte)157;
        arr[1] = 1;
        arr[2] = 0;
        arr[3] = 0;
        System.out.format("read 0x%x 0x%x 0x%x 0x%x \n",arr[3],arr[2],arr[1],arr[0]);
        int v = (arr[0] | (arr[1] << 8) | (arr[2] << 16) | (arr[3] << 24));
        System.out.format("read 0x%x\n",v);

    }

}
Run Code Online (Sandbox Code Playgroud)

我得到的输出为

read 0x0 0x0 0x1 0x9d 
read 0xffffff9d
Run Code Online (Sandbox Code Playgroud)

我预计输出应为0x0000019d

java byte-shifting

3
推荐指数
1
解决办法
245
查看次数

如何遍历char**指针?

我有以下代码

struct my_struct {
    const char **enjoy;
};

const char * enjy[] = {
    "Cricket", "movie", "",
    "Ball", "eat", "",
    };

static const struct my_struct my_struct_table[1] = {
    [0] = {
        .enjoy = enjy
        }
};
Run Code Online (Sandbox Code Playgroud)

现在我想使用那个最终结构,并希望使用它进行迭代.我该如何迭代使用my_struct_table[0].enjoy

我想打印enjy变量中的所有字符串.

c pointers loops

2
推荐指数
1
解决办法
8332
查看次数

标签 统计

byte-shifting ×1

c ×1

cherry-pick ×1

git ×1

git-cherry-pick ×1

java ×1

loops ×1

pointers ×1