didalam c# untuk mendeklarasikan array biasanya menggunakan code int[] namaVariabel=new int[dimensi array]. deklarasi seperti ini biasa dilakukan untuk mendeklarasikan type data array yang bersifat statis, maksudnya bersifat statis adalah jumlah dimensi dari array sudah dideklarasikan dari awal. sehingga variabel array tersebut sulit untuk dirubah dimensinya. akan tetapi jika jumlah data/dimensi dari array belum diketahui sebelumnya, maka programer harus menginisialisasikan dimensi array saat running program(saat program sudah berjalan). disini akan dibahas bagaimana membuat array dinamis, yaitu array yang bisa dirubah dimensinya sewaktu program berjalan
oke... disini akan dibahas cara mendeklarasikan array saat running program. yaitu ketika programer tidak mengetahui jumlah dimensi array yang akan dibentuk sebelumnya langkah
1: buat project baru, klik file pilih new project. pada kotak filename isi sesuai dengan kesukaan hati, misalnya inisialisasi array
langkah 2: tambahkan dua button dan satu datagridview, atur dan tata sedemikian rupa sehingga tampilannya seperti pada gambar diatas
langkah 3 : deklarasikan array global, ingat hanya deklarasi tanpa inisialisai. cari code berikut ini
langkah 4: tambahkan source code berikut ini pada button 1(array 4).
oke... disini akan dibahas cara mendeklarasikan array saat running program. yaitu ketika programer tidak mengetahui jumlah dimensi array yang akan dibentuk sebelumnya langkah
Gambar 1. Preview desain aplikasi
langkah 2: tambahkan dua button dan satu datagridview, atur dan tata sedemikian rupa sehingga tampilannya seperti pada gambar diatas
langkah 3 : deklarasikan array global, ingat hanya deklarasi tanpa inisialisai. cari code berikut ini
public partial class Form1 : Form
{
setelah tanda kurung kurawal, tambahkan code berikut ini untuk mendeklarasikan array{
int[] dataArray;
langkah 4: tambahkan source code berikut ini pada button 1(array 4).
dataArray = new int[4];
for (int i = 0; i < 4; i++)
{
dataArray[i] = i;
}
dataGridView1.Rows.Clear();
for (int i=0;i
{
dataGridView1.Rows.Add(1);
dataGridView1.Rows[i].Cells[0].Value = i+1;
dataGridView1.Rows[i].Cells[1].Value=dataArray[i];
}
for (int i = 0; i < 4; i++)
{
dataArray[i] = i;
}
dataGridView1.Rows.Clear();
for (int i=0;i
{
dataGridView1.Rows.Add(1);
dataGridView1.Rows[i].Cells[0].Value = i+1;
dataGridView1.Rows[i].Cells[1].Value=dataArray[i];
}
langkah 5: pada button 2(array 8), tambahkan code berikut ini
dataArray = new int[8];
for (int i = 0; i < 8; i++)
{
dataArray[i] = i;
}
dataGridView1.Rows.Clear();
for (int i = 0; i < dataArray.Length; i++)
{
dataGridView1.Rows.Add(1);
dataGridView1.Rows[i].Cells[0].Value = i + 1;
dataGridView1.Rows[i].Cells[1].Value = dataArray[i];
{
dataArray[i] = i;
}
dataGridView1.Rows.Clear();
for (int i = 0; i < dataArray.Length; i++)
{
dataGridView1.Rows.Add(1);
dataGridView1.Rows[i].Cells[0].Value = i + 1;
dataGridView1.Rows[i].Cells[1].Value = dataArray[i];
}
langkah 6: Done. selesai.
Jika langkah-langkah diatas dilakukan dengan benar, program akan berjalan dengan dua button, button satu mampu membuat array dengan empat element, sedangkan pada button dua mampu membuat array dengan delapan element. seandainya ingin membuat array dinamis, teknik yang digunakan sama dengan teknik satu dimensi seperti ini, hanya saja pada saat inisialisasi data, variable array yang dideklarasikan adalah array multidimensi, bukan satu dimensi lagi, untuk lebih memudahkan dalam pemahaman,
Download project silahkan download contoh programnya disini
For more information contact us on informasi@csharp-indonesia.com
NB : Dalam tutorial ini program ditulisa menggunakan IDE Visual studio 2010. dengan target framework 2.0 . Sehingga minimal komputer harus terinstal windows xp untuk bisa menjalankan program *.exe nya, Sedangkan untuk membuka projectnya mau tidak mau harus menginstal microsoft visual studio 2010
bagus bangat bos tutorialnya
BalasHapusTerimakasih, Semoga bisa bermanfaat
BalasHapusgeje
BalasHapus4guowenhao0827
BalasHapusmichael kors uk
giuseppe zanotti outlet
michael kors uk
iphone 6 cases
salomon shoes
cheap nba jerseys, http://www.nbajerseys.us.com
new balance 574
tory burch outlet online
adidas shoes
soccer shoes
louboutin shoes
coach handbags
evening dresses
tory burch outlet
kate spade outlet
kobe 9 elite
toms shoes
lacoste polo shirts
ralph lauren uk
oakley
kate spade handbags
cheap oakley sunglasses
new york knicks jersey
louis vuitton outlet store
air force 1 shoes
air max 2014
michael kors outlet online, http://www.michaelkorsoutletonlinstore.us.com
michael kors outlet online, http://www.michaelkors-outlets.us.com
toms shoes
christian louboutin sale
fred perry polo shirts
jordan shoes
cheap oakley sunglasses
kobe bryants shoes
michael kors outlet
chenlina20150916
BalasHapusmoncler jackets
ray ban outlet
true religion outlet
instyler curling iron
adidas superstar
longchamp outlet
instyler max
gucci shoes
adidas superstars
hermes uk
barbour jackets
nike air huarache
lebron james shoes
gucci
ralph lauren outlet
uggs boots on sale
basketball shoes
nike elite socks
hollister uk
nike free runs
cheap jerseys
coach outlet online
ralph lauren pas cher
belstaff
kate spade outlet
jordan pas cher
nike running shoes
louis vuitton handbags
cheap jordans
toms wedges
christian louboutin uk
nike free run
mont blanc
insanity workout
ray ban sunglasses outlet
burberry sale
polo ralph lauren
nike air force 1
new balance outlet
prada outlet
as
qihang1005,insanity workout
BalasHapusreplica watches
air force 1
jordan shoes
mont blanc pens
hollister kids
kobe bryant shoes
adidas superstar
ray ban sunglasses outlet
tommy hilfiger outlet
pandora
ray-ban sunglasses
canada goose outlet
nike cortez
kate spade outlet
fake oakley sunglasses
pandora bracelets
prada
ed hardy clothing
vans shoes
michael kors
nike trainers
michael kors handbags
nike running shoes
ralph lauren outlet
burberry outlet
pandora charms
toms outlet
nike elite socks
instyler curling iron
moncler jackets
louboutin
coach outlet
tod's shoes
mcm outlet
mizuno running shoes
coach outlet canada
q
2015-11-24 xiaozhengm
BalasHapuslouis vuitton
michael kors outlet
tommy hilfiger outlet
louis vuitton outlet
jordan 3 infrared
cheap uggs boots
north face
louis vuitton outlet
sac longchamp
rolex replica watches
louboutin pas cher
ralph lauren outlet
michael kors handbags
true religion
ed hardy uk
adidas originals
michael kors outlet
michael kors
uggs outlet
louis vuitton
hermes belt
michael kors outlet
air jordan uk
louis vuitton pas cher
michael kors handbags
ray ban
michael kors outlet online
nike air max uk
ghd
snapbacks wholesale
michael kors
jordan 3
michael kors outlet
louboutin
moncler jackets
oakley sunglasses
louis vuitton
michael kors uk
toms wedges
coach outlet
zhengjx20160326
BalasHapusburberry outlet
marc jacobs handbags
cheap ray ban sunglasses
bottega veneta shoes
true religion outlet
fitflops shoes
ray ban sunglasses
christian louboutin shoes
oakley sunglasses
michael kors outlet online
burberry bags
coach outlet online
michael kors handbags
burberry outlet online
air max
ray ban sunglasses
coach factory online
chi flat iron
fitflops
jimmy choo outlet store
instyler max
michael kors handbags
ralph lauren polo shirts
under armour
nike tn pas cher
coach outlet
nike running shoes
gucci borse
nike cortez shoes
stephen curry shoes
coach outlet store
abercrombie & fitch
lacoste shoes
rolex submariner
michael kors outlet online
vans store
kate spade outlet
jimmy choo
michael kors watches
asics gel kayano
oakley sunglasses wholesale
BalasHapustiffany jewelry
lululemon pants
swarovski crystal
ray-ban sunglasses
lululemon uk
ferragamo shoes
ralph lauren polo shirts
babyliss flat iron
coach handbags outlet
oakley sunglasses
ferragamo outlet
swarovski crystal
hollister uk
oakley sunglasses
rolex watches for sale
tiffany jewelry
ralph lauren uk
mulberry handbags sale
tiffany outlet
fitflops sale
cheap oakley sunglasses
louis vuitton handbags
ralph lauren pas cher
ralph lauren uk
true religion outlet
true religion outlet
oakley sunglasses
ray ban sunglasses
michael kors outlet uk
cai20160329
zhengjx20160411
BalasHapuscopy watches
louboutin femme
ed hardy outlet
polo ralph lauren outlet
michael kors handbags
louis vuitton handbags
coach outlet
ray ban outlet
oakley sunglasses
hollister clothing
nike roshe run
burberry handbags
coach outlet store
air max 95
ray ban outlet
jordan retro 4
tory burch flats
michael kors handbags
michael kors outlet clearance
hollister clearance
michael kors outlet
jordan retro 13
michael kors outlet clearance
cheap nfl jerseys
tiffany and co
nike blazers shoes
coach factory outlet
prada handbags
timberlands
michael kors handbags
ray ban sunglasses
gucci handbgs
oakley sunglasses
louis vuitton bags
hollister clothing store
oakley outlet
tiffany and co
gucci belts
jordan 6s
louis vuitton purses
cheap nfl jerseys
BalasHapusadidas shoes
reebok
jimmy choo outlet store
nike blazer
adidas supercolor pink
oakley sunglasses wholesale
cheap oakley sunglasses
oakley sunglasses cheap
fitflops
canada goose outlet
cheap ray-ban sunglasses outlet
louis vuitton bags
burberry bags
bottega veneta sale
fitflops shoes
louis vuitton borse
abercrombie & fitch
gucci handbags outlet
toms outlet
michael kors outlet stores
babyliss hair dryer
nike force 1
michael kors outlet online
coach factory outlet
michale kors uk
prada handbags
rolex replica watches
versace sunglasses wholesale
michael kors outlet online
hollister clothing
pandora charms
armani exchange
ralph lauren outlet
louboutin pas cher
longchamp outlet
cheap jordan shoes
adidas trainers
jimmy choo
hollister hoodies
chenzhen20160510
los angeles clippers
BalasHapusinstyler
bengals jersey
giuseppe zanotti shoes
boston celtics jerseys
abercrombie outlet
saints jerseys
ysl outlet online
texans jerseys
air max 2014
san diego chargers jersey
cleveland cavaliers
seattle seahawks jersey
new york knicks jerseys
valentino outlet
cleveland cavaliers jersey
jets jersey
washington redskins jerseys
fred perry polo shirts
marc jacobs
miami dolphins jersey
denver broncos jerseys
baltimore ravens jersey
new england patriots jerseys
pittsburgh steelers jersey
baltimore ravens jerseys
dallas cowboys jerseys
indianapolis colts jerseys
ferragamo outlet
colts jerseys
kansas city chiefs jersey
patriots jerseys
green bay packers jersey
nike trainers
ysl outlet
linyuan0517
chenlina20160709
BalasHapuslouis vuitton outlet
coach outlet
louis vuitton handbags
adidas ultra boost
gucci outlet
polo ralph lauren outlet
louis vuitton outlet
louis vuitton handbags
fitflops shoes
nike uk
ray ban sunglasses
ray ban wayfarer
coach outlet store online
air jordans
coach outlet store online clearances
christian louboutin shoes
adidas uk
ray ban sunglasses
michael kors outlet clearance
ray ban sunglasses
jordan retro
toms shoes
true religion sale
instyler max
adidas superstars
cheap jordan shoes
cheap oakley sunglasses
adidas shoes
michael kors outlet
ray ban sunglasses
kobe 11
tory burch outlet
nike free runs
michael kors
ray ban sunglasses discount
polo ralph lauren
coach outlet
nike roshe run
air jordan 8
michael kors outlet
as
true religion jeans outlet
BalasHapusoakley sunglasses outlet
louis vuitton handbags
canada goose sale
moncler uk
coach outlet online
cheap ray bans
michael kors handbags
dolce and gabbana outlet online
jordan pas cher
longchamp outlet store
babyliss hair dryer
nike store uk
ecco outlet
kate spade bags
polo ralph lauren
cheap ray ban sunglasses
chaussure louboutin
ralph lauren uk
timberland uk
tiffany jewelry
michael kors purses
armani outlet
ghd hair dryer
louis vuitton borse
christian louboutin sale
ugg boots outlet
coach outlet online
yeezy boost 750
under armour
adidas superstar white
pandora charms sale clearance
louis vuitton outlet online
20160722caiyan
ray ban sunglasses
BalasHapusjordan 11
uggs canada
louis vuitton bags
polo ralph lauren
louis vuitton handbags
fitflops sale clearance
louis vuitton handbags
rolex watches
hogan scarpe
tory burch flats
instyler curling iron
oakley vault
louis vuitton
coach outlet
washington wizards jerseys
longchamp sac
kevin durant shoes 8
ray ban sunglasses
polo ralph lauren
retro jordans
cheap uggs
polo ralph lauren
giuseppe zanotti
timberland boots
timberland boots
louis vuitton outlet
ray ban sunglasses outlet
new york knicks jerseys
christian louboutin outlet
true religion jeans
michael kors outlet
louis vuitton outlet
giuseppe zanotti sneakers
cartier watches
true religion outlet
coach factory outlet
uggs on sale
ray ban sunglasses uk
20168.15wengdongdong
jianbin0829
BalasHapustods shoes sale
ferragamo outlet
michael kors outlet store
swarovski crystal
ferragamo shoes
longchamp handbags
air jordan 11
fitflops clearance
polo pas cher
cheap uggs
ralph lauren femme
tiffany jewellery
michael kors handbags outlet
longchamp pliage
ugg outlet
polo ralph lauren
canada goose outlet store
michael kors outlet online
cartier watches
uggs outlet
hollister canada
air jordan 13
nike outlet
versace sunglasses
coach outlet clearance
oakley sunglasses sale
longchamp outlet
swarovski outlet
tory burch outlet online
adidas yeezy boost
BalasHapusmichael kors outlet
adidas superstar UK
ray ban sunglasses outlet
nike air zoom structure 19
nmd adidas store
ray ban sunglasses
adidas tubular
air max thea
tiffany jewelry
dolphins jerseys
BalasHapusmichael kors handbags
lions jerseys
michael kors outlet
michael kors handbags
green bay packers jerseys
the north face outlet
eagles jerseys
cheap ray ban sunglasses
michael kors handbags online
supra shoes sale
BalasHapuscoach handbags
ecco shoes outlet
salomon shoes
skechers shoes
cardinals jersey
red valentino
nike blazer
michael kors outlet
nike trainers
bengals jersey
BalasHapusarizona cardinals jerseys
new balance outlet
coach handbags
converse shoes
mont blanc pens
ray bans
nhl jerseys
nike huarache
kobe 9
20170707 leilei3915
BalasHapuskate spade outlet store
michael kors outlet online
cheap oakley sunglasses
pandora charms
michael kors outlet
true religion outlet
coach outlet store online
hermes birkin
nike shoes
polo shirts
I'm puzzled with lots of exercises. I was afraid I could not do the right time despite my hard work. I need a support person.
BalasHapushttp://run3play.com
adidas stan smith shoes
BalasHapuskyrie irving shoes
fila
nike shoes
louboutin shoes uk
golden goose
michael kors
supreme hoodie
off white hoodie
goyard handbags
You made some respectable points there. I appeared on the web for the difficulty and found most individuals will go along with together with your website. noticiasdealcorcon.com
BalasHapusHis idyllic existence is one day broken when a team of heavily armed men turn his house into dust in an attempt to kill him, it’s up to him then and a few old friends to try and get to the bottom of the mysterious kill squad. https://hadeelweb.com
BalasHapusoff white hoodie
BalasHapuskyrie 7
supreme clothing
golden goose
100% real jordans for cheap
jordan sneakers
bape hoodie
kyrie 5 shoes
supreme clothing
yeezys
navigate to this site dildo,sex chair,realistic dildo,dildos,dog dildo,vibrators,dog dildo,realistic dildo,sex toys,cheap sex toys browse this site
BalasHapusclick this replica designer bags wholesale published here high replica bags click to find out more 7a replica bags wholesale
BalasHapusclick this link here now q0c00n9v21 gucci replica replica bags on amazon replica zara bags replica gucci handbags b0z88q2i01 replica bags dubai 7a replica bags philippines replica hermes bag p9l89t9k52 replica prada nylon bags
BalasHapusx4o24q9u43 w8s14c5h90 f8z96h5g37 q1r73o6r60 m8o07c3w56 f9t91n1r48
BalasHapus