program error when enter data in array and display null

前端 未结 2 1295
北海茫月
北海茫月 2021-01-29 16:52

i have done some correction by referring in here, but still haven quite satisfy of my program and it still not complete.
Problem 1 = my displayReg() comes out \"nullnullnull

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 17:12

    Register[] a = new Register[i]; - creates an array with 0 items.

    a[i].Reg(); - access to the position 0 of an array that got no items at all.

    Here is a tutorial

提交回复
热议问题