Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include "var.h"
void hello1(const char *s) {
printf("hello1 %s\n", s);
}
void hello2(const char *s, const char* s2) {
printf("hello2 %s and %s\n", s, s2);
}
@zzt93
zzt93 / Iter.java
Created July 30, 2015 03:01
Getting Iterator first then modify container will invalidate the iterator and cause `java.util.ConcurrentModificationException` for `next()` and `remove()` but not `hasNext()`
package so_test;
import java.util.ArrayList;
import java.util.Iterator;
/**
* Created by zzt on 7/30/15.
* <p>
* Description:
* Getting Iterator first then modify container will
package lambda;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
/**
* Created by zzt on 5/25/15.
* <p>
* Description:
@zzt93
zzt93 / extern_const.cpp
Last active August 29, 2015 14:14
Extern const array
#include <iostream>
#include "extern_const.hpp"
const int n = 10;
//const int a[] = {1, 2}; // this is also ok
extern const int a[] = {1, 2};
int main(int argc, char *argv[])
{
increse();
@zzt93
zzt93 / Java constant - final
Last active August 29, 2015 14:14
Java constant - final
Java constant - final