知識補充:在本地和gitlab上創建新分支以及字符串strcpy和直接等於

1.在本地和gitlab上創建新分支

git checkout -b fixspacequestion origin/master

git add /.

git commit -m 'fix space question'

git push origin fixspacequestion


2.字符串strcpy和直接等於

strcpy爲把一個字符串地址的內容賦值給另一個字符串地址,而直接等於只是把指針賦給另一個字符串,具體如下:

char *a = "aaaaa";

char *b = a;

b的地址等於a,內容也等於a。

char *a = "aaaaa";

char *b = (char*)malloc(6*sizeof(char));

strcpy(b, a);

b的地址不等於a,內容等於a。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章