Command | Description |
---|---|
git init |
Create Git repository |
git clone [repository] |
Clone Git repository |
git add [file] |
Add file to staging area |
git rm --cached [file] |
Remove file from staging area |
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
/* | |
The MIT License (MIT) | |
Copyright (c) 2020 Andreas Pfohl | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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 <stdlib.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#include <sys/shm.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ | |
/* shared memory segment */ |
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 <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <sys/msg.h> | |
#include <sys/wait.h> | |
#include <string.h> | |
/* message structure */ | |
struct message { | |
long mtype; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <gc/gc.h> | |
struct node { | |
int i; | |
}; | |
struct node *new_node(int i) | |
{ |
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> | |
union env { | |
void (*func)(); | |
}; | |
void foo(int a, int b) | |
{ | |
printf("%d\n", a + b); | |
} |
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
/* | |
* Save as "sort.c". | |
* Compile with "CXXFLAGS=-std=c++11 make sort". | |
*/ | |
#include <iostream> | |
#include <algorithm> | |
struct Distance { | |
int index; |
- https://pauladamsmith.com/blog/2015/01/how-to-get-started-with-llvm-c-api.html
- http://walfield.org/blog/2010/08/25/lambdas-in-c.html
- http://www.holub.com/software/compiler.design.in.c.html
- http://stephen-brennan.com/2015/01/16/write-a-shell-in-c/
- http://programmers.stackexchange.com/questions/62502/small-c-projects
- https://github.com/ryanmjacobs/c
- http://stackoverflow.com/questions/599365/what-is-your-favorite-c-programming-trick
- http://danluu.com/malloc-tutorial/
- http://cslibrary.stanford.edu/101/
- http://libcello.org
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> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
FILE *fp = fopen("file.c", "r"); | |
char *line = NULL; | |
size_t linelen = 0; | |
ssize_t len; |
NewerOlder