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 <iostream> | |
using namespace std; | |
void addFiveToNum(int &n); | |
int main() { | |
int myNumber1 = 10; | |
int myNumber2 = 20; | |
cout << "Before" << endl << "------" << endl; |
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
/* | |
* A simple example of an object in ANSI C. | |
* It would be better to have initAdder simply call malloc | |
* and return a pointer to the new object (and be preferable too) | |
* as this would allow for freeing of objects too but for the sake of | |
* simplicity I've opted to pass it a pointer instead. | |
* | |
* Note that with C++ the "this" variable is pretty much just implicit. | |
* | |
*/ |
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
/* | |
* A simple example of an object in ANSI C. | |
* This example uses malloc to create the new object. | |
* | |
* Note that with C++ the "this" variable is pretty much just implicit. | |
* | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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> | |
/* This insertAt function takes an index to insert at "i", | |
* a number to insert into the integer array "num", a pointer | |
* to the current number of used spaces in the array "numUsed", | |
* and a pointer to the array "a". | |
* | |
* This assumes that the array is big enough to insert a new element | |
* for the sake of simplifying the example so it doesn't check against |
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 s1[256],s2[256],s3[256]; | |
int i; | |
sscanf("MPTRAY=FIRST [3 ENUMERATED READONLY]", | |
" %s [%d %s %s]", | |
s1, &i, s2, s3); |
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 <iostream> | |
using namespace std; | |
void change_array(int a[], int i, int n) { | |
a[i] = n; | |
} | |
int main() { | |
int a[] = {1,2,3,4,5,6}; | |
change_array(a, 3, 789); |
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
/* | |
* An implementation of the Wavelet Tree data structure. | |
* It is similar to a binary search tree using bits. | |
* | |
* More info here: | |
* http://siganakis.com/challenge-design-a-data-structure-thats-small | |
* http://www.alexbowe.com/wavelet-trees | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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> | |
int points[100000][2]; | |
int i, j, k; | |
int q; | |
int count[4]; | |
inline void mirror() { | |
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
/* | |
* This is a parser intended for Common Log Format access logs. | |
* It splits on whitespace unless it is part of a field delimited by | |
* square brackets or double quotes. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "parser.h" |
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
package main; | |
import ( | |
"exp/gui" | |
"exp/gui/x11" | |
"image" | |
) | |
func main() { | |
w,_ := x11.NewWindow() |
OlderNewer