which datatype i have to use we i need dynamic size.for eg.
empname .in first row it have only five chars.but next row it
have 100 chars.

Answers were Sorted based on User's Feedback



which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / mahesh kotekar

When there is a requirement of storing different length of
characters in an array . We can use jagged arrays.
int[][] jagged = new int[3][];
jagged[0] = new int { 1,2,3 };
jagged[1] = new int { 1, 2, 3, 4, 5 };
jagged[3] = new int { 1, 2, 3, 4, 5, 6, 7, 8,9};

Is This Answer Correct ?    3 Yes 1 No

which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / radhika

i think we can use arraylist for dynamic size
for example
arraylist al= new arraylist();
al[0]="empname";
al[1]="empname is ............";

Is This Answer Correct ?    3 Yes 1 No

which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / kishore

we can use arraylist for dynamic size

Example:
Arraylist arlst=new Arraylist();
arlstl[0]="empname";
arlstl[1]="xyzz.........";

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is the Signification of the "new " keyword in C#? example

0 Answers   Wipro,


Can you declare the override method static while the original method is non-static?

3 Answers  


When static constructor is invoked?

9 Answers   TCS,


What is the difference between yield and return?

0 Answers  


why delegate is type safe?

0 Answers   IBS,






What is func c#?

0 Answers  


Can we write one page in c# and other in vb in one application ?

3 Answers   Keane India Ltd,


Explain Direct CAST vs CType ?

0 Answers   MCN Solutions,


Is there hashmap in c#?

0 Answers  


What are jagged arrays used for?

0 Answers  


Is it possible to have a static indexer in c#?

0 Answers  


What is difference between assembly and dll?

0 Answers  


Categories