Skip to content

Instantly share code, notes, and snippets.

View zironycho's full-sized avatar
🎨
I may be slow to respond.

Juncheol Cho zironycho

🎨
I may be slow to respond.
View GitHub Profile
@zironycho
zironycho / test-strtrim.c
Created September 28, 2016 02:22
remove white spaces (frontside and backside)
#include <stdio.h>
#include <ctype.h>
#include <string.h>
static void strtrim(char *inout)
{
char *start = inout;
char *end = inout + strlen(inout) - 1;
int i;
@zironycho
zironycho / test-auto-with-lvalue-reference.cpp
Last active September 5, 2016 02:28
test auto keyword with lvalue's reference
class A {
public:
A() : _value(0) {}
int& get() { return _value; }
void print() { std::cout << _value << std::endl; }
private:
int _value;
};
@zironycho
zironycho / test-vector-capacity.cpp
Last active August 22, 2016 04:09
test c++ vector capacity
#include <iostream>
#include <vector>
int main(void) {
std::vector<int> v;
v.resize(10);
std::cout << v.capacity() << std::endl;
v.clear();
std::cout << v.capacity() << std::endl;
v.resize(0);