Hola aguml.
Pero, no habías comentado que estabas implementando la función en un proyecto con interfaz gráfica ...
Usala de este modo:
Código PHP:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
srand (time(0));
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int v[3][3] = {{1,2,3}, {4,5,6}, {7,8,9}};
String s;
Memo1->Lines->Clear();
Memo1->Lines->Add("Matriz original");
for(int f = 0; f < 3; f++) {
s = "";
for(int c = 0; c < 3; c++)
s = s + String(v[f][c]) +",";
Memo1->Lines->Add(s);
}
Memo1->Lines->Add("");
Memo1->Lines->Add("Matriz modificada");
random_shuffle(&*v[0], &*v[3]);
for(int f = 0; f < 3; f++) {
s = "";
for(int c = 0; c < 3; c++)
s = s + IntToStr(v[f][c]) +",";
Memo1->Lines->Add(s);
}
}
Saludos