“Daftar 2D di Dart” Kode Jawaban

Array 2d Dart

//Array 2d Dart
int row = 3;
int col = 4;

var twoDList = List.generate(row, (i) => List(col), growable: false);

//For fill;
twoDList[0][1] = "deneme";

print(twoDList);

// [[null, deneme, null, null], [null, null, null, null], [null, null, null, null]]
Dull Dove

Daftar 2D di Dart

 //Declare and initialize a matrix x having 
 //m rows and n columns, containing real numbers.

var x = new List.generate(m, (_) => new List(n));
Bijay Poudel

daftar multi-dimensi di panah

int a = 3;
int b = 3;

var tList = List.generate(a, (i) => List(b), growable: false);
print(tList); 
// [[null, null, null], [null, null, null], [null, null, null]]
Fancy Fly

Jawaban yang mirip dengan “Daftar 2D di Dart”

Pertanyaan yang mirip dengan “Daftar 2D di Dart”

Lebih banyak jawaban terkait untuk “Daftar 2D di Dart” di Dart

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya