在visual basic中需要数组帮助 [英] need a help in array in visual basic

查看:72
本文介绍了在visual basic中需要数组帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

告诉我如何在多维数组/ 2D数组中存储以下细节?





tell me how to store the following details in multidimensional array / 2D array?


name    age   address
raja    72    london
mala    56    colombo
sunil   34    canada

推荐答案

Don' t。

创建一个具有三个属性的类:

Don't.
Create a class which has three properties:
Name    (string)
Age     (int), or better DateOfBirth (DateTime)
Address (string)

然后创建一个类实例的一维数组(或更好的List),每个条目一个实例。

那样相关数据组织得更好,并保持在一起。

Then create a one dimensional array (or better a List) of the class instances, one instance per entry.
That way the relevant data is better organised, and kept together.


这篇关于在visual basic中需要数组帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆