pastebin

Paste Search Dynamic
Recent pastes
vendorCode
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <boost/make_shared.hpp>
  5. typedef unsigned int u32;
  6. using namespace std; // consider removing this line in serious projects
  7.  
  8. class A
  9. {
  10. public:
  11.         A(std::string name):name_(name) {}
  12.         ~A() { cout << "~A: " << name_ << endl; }
  13.         std::string name() { return name_; }
  14.         std::string name_;
  15. };
  16.  
  17. void f1()
  18. {
  19.     const std::string uidStr = "AA123456";
  20.     const std::string vendorCode = std::string(uidStr.begin(), uidStr.begin()+2);
  21.     const std::string serialNumber = std::string(uidStr.begin()+2, uidStr.end());
  22.  
  23.     std::cout << vendorCode << endl;
  24.     std::cout << serialNumber << endl;
  25. }
  26. int main()
  27. {
  28.         f1();
  29.         std::cout << endl;
  30.         return 0;
  31. }
Parsed in 0.012 seconds