-
Notifications
You must be signed in to change notification settings - Fork 0
/
c.txt
22 lines (22 loc) · 929 Bytes
/
c.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
return (f == r ? 1 : 0);
int a[]; // equivalent to "int *a"
int *p = a; // equivalent to "int *p = &a[0]"
while(*string++); // jump to the end of the string
i = 0; while(string[i++]); // jump to the end of the string
void (*fp) (int); // pointer to a function
while (/* some condition */) {} // "{}" is like "pass" in python
int i = 123;
int *p = &i; // pointer to i
int **pp = &p; // pointer to p
struct TemperatureNode node = {0}; // set all struct fields to 0
fread(arr, sizeof(int), 10, ptr);
struct *car = malloc(sizeof(struct car));
typedef oldname newname;
a[i] == *(a + i); // these two statements are the same thing
memcpy(destination, source, bytes);
free(x);
x = malloc(sizeof(int));
sprintf(string, "%d", 42); // convert int to string
int num = strtol(s, NULL, 10); // convert string to long int
if(text[0] == '\0') {} // check if a char array is empty
if (strcmp(text, "") == 0) // check if a char array is empty