luca是细胞演变类型的游戏,但是这个游戏缺少游戏内指引。
tiny elevator是电梯把员工送出去的模拟类游戏
night at the 8th warehouse是一个恐怖游戏,横板过关
tiny spiders adventure是一个横板过关游戏,玩家需要控制蜘蛛击败boss
creatures cory是一个类似画中世界+华容道的解谜类游戏
The main branch drop-down bar(下拉栏) will reflect your new branch and display the new branch name.
![[image/GitHub_note-1.png]]
确保名字是my-first-branch,会触发GitHub Action去推进教程
![[image/GitHub_note-2.png]]
commit - 在branch里面
commit是什么
What is a commit?: A commit is a set of changes to the files and folders in your project. A commit exists in a branch. For more information, see “About commits”.
commit一个PROFILE.md文件
commit一个PROFILE.md文件的更新
以上都是commit的操作
pull request - 创建并完成
What is a pull request?: Collaboration happens on a pull request. The pull request shows the changes in your branch to other people and allows people to accept, reject, or suggest additional changes to your branch. In a side by side comparison, this pull request is going to keep the changes you just made on your branch and propose applying them to the main project branch. For more information about pull requests, see “About pull requests”.
start from scratch, we already know what is variable. A variable store in memory have not only information of its value, but also its memory address.
1
int x = 5; // declare and initializa a variable
then we can use “address-of operator” - & to get the address of x!
1
int* ptr = &x //get the x's address and pass it to ptr
you may ask
why * ptr is a int type data
you are saying that ptr is a pointer to an int.
where should I place the asteroid *? - Is that with end of int, or with beginning of ptr
only matter of style
However, the first style (int* ptr) is often preferred because it makes it clear that ptr is a pointer to an int. This can be especially helpful when declaring multiple pointers in a single statement:
int* ptr1, ptr2; // Only ptr1 is a pointer, ptr2 is an int
better declare one pointer per line
since the name of & is "address-of operator"取地址符, what is the name of * as operator
it is called as "dereference operator"解引用符
BEAWARE that & also have another way to use, which is reference
int &reference_value = value means give it a new name, and all operations on reference_value is same as directly on value
You can use the pointer to access the value of x:
1
int value = *ptr; // Dereferencing the pointer to get the value of x
Example
example code
1 2 3 4 5 6 7 8 9 10 11 12 13
#include<iostream>
intmain(){ int x = 10; // Declare an integer variable x and initialize it to 10 int* ptr = &x; // Declare a pointer to an integer and initialize it with the address of x
std::cout << "Value of x: " << x << std::endl; // Output the value of x std::cout << "Address of x: " << &x << std::endl; // Output the address of x std::cout << "Value of ptr: " << ptr << std::endl; // Output the value of ptr (address of x) std::cout << "Value pointed to by ptr: " << *ptr << std::endl; // Output the value pointed to by ptr (value of x)
return0; }
result
1 2 3 4
Value of x: 10 Address of x: 0x7ffee4b3c8ac Value of ptr: 0x7ffee4b3c8ac//ptr = &x Value pointed to by ptr: 10//*ptr = x
p.s. about address on a 64-bit system, a memory address might look like 0x7ffee4b3c8ac. Here’s why:
0x: This prefix indicates that the number is in hexadecimal format.
7ffee4b3c8ac: This is the actual address in hexadecimal. Each digit represents 4 bits, so a 64-bit address will have up to 16 hexadecimal digits.
summary
x is a variable that stores a value.
&x is the address of the variable x.
ptr is a pointer that stores the address of x.
*ptr is the value stored at the address ptr points to.