当我尝试git添加我的文件时,我输入了
git add <insert file names here>
Run Code Online (Sandbox Code Playgroud)
这工作正常.但是,当我尝试做的时候
git commit -a
Run Code Online (Sandbox Code Playgroud)
我的git存储库告诉我它是空的.输出的是:
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
<insert name of files here>
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)
可能有人知道解决方案吗?谢谢.
我有一个8位的字符串,我想将其转换为1个字节.我不确定为什么我的功能不能正常工作.我将8位存储到8个无符号字符的数组中.到目前为止这是我的方法:
unsigned int bitsToBytes(unsigned char *bits)
{
unsigned int sum = 0;
for(int i = 7; i >= 0; i--)
{
sum += bits[i];
sum<<=1;
}
return sum;
}
int main()
{
unsigned char bits[8];
unsigned int byt;
byt = bitsToBytes(bits);
cout << byt; //doesn't give me the right result
}
Run Code Online (Sandbox Code Playgroud)
编辑:我的数组在数组中包含'1'和'0'!对不起,不清楚.
可能有人知道我在哪里出错了吗?我不确定为什么我的位没有正确转换为字节.有人可以帮忙吗?谢谢!