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 <cstdlib> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
template<typename T> | |
struct comparator | |
{ | |
bool operator()(const T & a, const T & 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
#include <stdio.h> | |
#include <stdlib.h> | |
int doit(int array[]) | |
{ | |
int i; | |
int sum=0; | |
for(i = 0; i < 10 ; ++i) | |
{ | |
sum += array[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> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <limits.h> | |
#define ONE_YEAR 60*60*24*366 | |
int main(void) | |
{ | |
time_t now = 67767751872000000l; | |
for(;;) | |
{ |
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> | |
#include <string.h> | |
#include <limits.h> | |
#define ONE_ARG 2 | |
#define DECIMAL 10 | |
typedef enum { FALSE, TRUE } BOOLEAN; |
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 "utility.h" | |
/** | |
* this function is required for buffer clearing. It simply removes all | |
* characters from the input buffer. Note: you should only call this when | |
* you detect buffer overflow. | |
**/ | |
void read_rest_of_line(void) | |
{ | |
int ch; |
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> | |
#include <errno.h> | |
#include <string.h> | |
int main(void) | |
{ | |
FILE * fp = fopen("foo", "r"); | |
if(!fp) | |
{ |
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
syntax on | |
set autoindent | |
set smartindent | |
set ts=4 sw=4 et si | |
set whichwrap +=<,>,[,] | |
set backspace=indent,eol,start | |
set hlsearch | |
set number | |
set mouse=a | |
"set foldmethod=syntax |
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 <string> | |
#include <iostream> | |
#include <cstdlib> | |
void moveit(std::string& s) | |
{ | |
std::string mys = std::move(s); | |
} | |
int main(void) |
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 warning(){} | |
int main(void) | |
{ | |
printf("%d\n", warning()); | |
return EXIT_SUCCESS; | |
} |
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> | |
void doit(void) | |
{ | |
int array[4] = {0}; | |
int i; | |
for(i = 0; i <= 20; i++) | |
{ | |
array[i]-=8; |
OlderNewer