Skip to content

Instantly share code, notes, and snippets.

@chaojian-zhang
Created October 28, 2021 03:17
Show Gist options
  • Save chaojian-zhang/0733c164341442dafe42feb3e83e4c36 to your computer and use it in GitHub Desktop.
Save chaojian-zhang/0733c164341442dafe42feb3e83e4c36 to your computer and use it in GitHub Desktop.
Basic Lectures on C
int main()
{
int a = 5;
int* b = &a;
int c[] = {1, 2, 3, 4, 5};
return 0;
}
int main()
{
short s = 5; // 2
short int si = 5; // 2
int i = 5; // 4
long l = 5; // 4; 5012
long int li = 5; // 5012-4=5008
long long ll = 5;
long long int lli = 5;
char c = 'a';
return 0;
}
int main()
{
int a = 5;
long long b = &a;
int* c = &a;
int d = *c;
return 0;
}
int main()
{
int a[] = {1, 2, 3, 4, 5}; // &, *, &c, &c[0], c+0, c[5], &c[5], c+5, *(c+5)
int* b = a;
int* c = &a;
*(int*)(b+4);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment