#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;

int main()
{
	string name[2] = {
		string("1234", sizeof("1234")),
		string("567", sizeof("567"))
	};
	
	string list[] = {"A1", "A2"};
	string str = "";
	str.append("{");
    for (int i = 0; i < 2; i++) {
		str.append(list[i]);
		str.append(":");
		str.append(name[i]);
		str.append(",");
    }
	str.pop_back();
	str.append("}");
	
	cout << "cout: " << str << "\n";
	
	const char *s = str.c_str();
	cout << "send: " << s << "\n";

	return 0;
}