[ create a new paste ] login | about

Link: http://codepad.org/SJdCZw1Y    [ raw code | output | fork ]

k06a - C++, pasted on Apr 4:
#include <map>
#include <string>
#include <vector>
#include <iostream>

int main()
{
    typedef std::vector<char> Blob;
    std::map<std::string,std::vector<Blob> > dict;

    char text[] = "abcdef";
    dict["123"].push_back(Blob(text+0, text+2));
    dict["456"].push_back(Blob(text+0, text+2));
    dict["456"].push_back(Blob(text+2, text+4));
    dict["456"].push_back(Blob(text+4, text+6));
    dict["789"].push_back(Blob(text+4, text+6));
    
    std::cout << dict.size() << std::endl;
    std::cout << dict["123"].size() << std::endl;
    std::cout << dict["456"].size() << std::endl;
    std::cout << dict["789"].size() << std::endl;
}


Output:
1
2
3
4
3
1
3
1


Create a new paste based on this one


Comments: