[ create a new paste ] login | about

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

C++, pasted on Jun 11:
#include <string>
#include <iostream>
using namespace std;

int main()
{
	int i, j;
	string ** s_dynamic;
	string s_static[3][2] = 
	{
		{"11", "12"},
		{"21", "22"},
		{"31", "32"}
	};

	s_dynamic = new string *[3];
	for(i = 0; i < 3; i++)
		s_dynamic[i] = s_static[i];

	for(i = 0; i < 3; i++)
	{
		for(j = 0; j < 2; j++)
			cout<<s_dynamic[i][j]<<" ";
		cout<<endl;
	}
	cin.get();
	return 0;
}


Output:
1
2
3
11 12 
21 22 
31 32 


Create a new paste based on this one


Comments: