Skip to content

Instantly share code, notes, and snippets.

View AndyNovo's full-sized avatar

Andy Novocin AndyNovo

View GitHub Profile
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> coll; // vector container for integer elements
// append elements with values 1 to 6
for (int i=1; i<=6; ++i) {
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
// type of the collection
typedef multimap<int,string> IntStringMMap;
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
/* type of the container:
* - map: elements key/value pairs
* - string: keys have type string
#include <iostream>
#include <set>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{
/* type of the collection:
* - no duplicates
#include <iostream>
#include <algorithm>
#include <functional>
#include <iterator>
using namespace std;
int main()
{
int coll[] = { 5, 6, 2, 4, 1, 3 };
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(){
srand(time(0));
int even = 0;
int odd = 0;
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int* x = (int*) malloc(32);
x[0] = 23;
cout << x[0] << endl;
@AndyNovo
AndyNovo / error3.cpp
Last active September 21, 2016 15:26
#include <iostream>
using namespace std;
int main() {
int* p2int;
*p2int = 23;
cout << *p2int << endl;
}
#include <iostream>
#include <string>
using namespace std;
//Classic Linked List
template<typename DataType>
struct Node {
Node<DataType>* next;
DataType data;
#include <iostream>
#include <gmp.h>
using namespace std;
int main(){
mpz_t x,y,z;
mpz_init(x);
mpz_init(y);
mpz_init(z);
mpz_set_str(x, "1234567890123456789012345678901234567890", 10);