Demo entry 6632721

asdf

   

Submitted by anonymous on Jul 28, 2017 at 14:34
Language: C++. Code size: 1.6 kB.

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <iostream>
#include <vector>


#if 1
int main(int argc, char **argv) 
{
    std::vector<int> *xx=new std::vector<int>();
    std::vector<int> &_xx=*xx;

    for ( int i=0; i < 10; i++ ){
        _xx.push_back(i);
    }
}


#endif
#if 0
#include <boost/regex.hpp>

int main(int argc, char **argv) 
{
  std::string s = "Boost Libraries";
  boost::regex expr("(\\w+)\\s(\\w+)");
  boost::smatch what;
  if (boost::regex_search(s, what, expr))
  {
    std::cout << what[0] << '\n';
    std::cout << what[1] << "_" << what[2] << '\n';
  }
#if 0
  std::string s = "giop:tcp:192.168.176.102:34561";
  boost::regex expr("(.*):([^:]*)$");
  boost::smatch what;
  if (boost::regex_search(s, what, expr))
  {
    std::cout << what[0] << '\n';
    std::cout << what[1] << "_" << what[2] << '\n';
  }
#endif
}

#endif

#if 0
#include <boost/algorithm/string.hpp>
bool isColon(char c)
{
	return c==':';
}

bool notColon(char c)
{
	return c!=':';
}
int main(int argc, char **argv) 
{	
    //std::string msg = "::StartMsg :: Hello :: EndMsg::";
    std::string msg = "giop:tcp:192.168.176.102:34561";
    boost::algorithm::trim_if(msg, &notColon);
    std::cout<<"["<< msg <<"]"<<std::endl;
 
    msg = "::StartMsg :: Hello :: EndMsg::";
    boost::algorithm::trim_left_if(msg, &isColon);
    std::cout<<"["<< msg <<"]"<<std::endl;
 
    msg = "::StartMsg :: Hello :: EndMsg::";
    boost::algorithm::trim_right_if(msg, &isColon);
    std::cout<<"["<< msg <<"]"<<std::endl;
}
#endif

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).