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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multicast delegate explain with example?

654


Write a sample code to write the contents to text file in c#?

656


What are data types examples?

684


What is the difference between readkey and readline in c#?

654


What is the use of generics in c#?

629


Can I use exceptions in c#?

746


What is the purpose of abstract class in c#?

664


What are the two uses of a ‘using’ statement in c#?

664


What is array and its types in c#?

697


What is console used for?

734


Why would you use a class property in c#?

682


What does exclamation mark mean in access query?

756


What is singleordefault c#?

687


What is managed or unmanaged code?

843


What are extensions in c#?

728