This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void foo(void) { | |
int tmp; | |
printf("%d\n", tmp); | |
tmp = 999; | |
} | |
int main() { | |
foo(); // 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() { | |
char ch = 8; // 1 + 3 | |
int it = 9; // 4 + 4 | |
int* ptr = ⁢ // 8 | |
printf("%p\n%p\n%p\n\n", &ch, &it, &ptr); | |
typedef struct { | |
short sit; // 2 + 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
// 储存方式的判断 | |
unsigned int a = 0x12345678; | |
const char* buf = (char*)&a; | |
printf("%x\n%x\n", buf[0], buf[3]); | |
// 78 12, 所以是小端存储 | |
const char* str = "12345678"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMP=`pwd`/go-cmd-`date +%s` | |
GOX=src/golang.org/x | |
mkdir -p $TMP/$GOX | |
cd $TMP/$GOX | |
git clone https://github.com/golang/tools.git | |
git clone https://github.com/golang/net.git |
NewerOlder