Click here to Skip to main content
15,883,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir,

1. if statement with 2 condition
2. 2 different length of string array.
ex.
C#
string[] str={"Hai","welcome","To","Code","Project"};
       string[] str2={"By","Mohan","Kumar"}
     
      str.length=5;
      str2.length=3;


okey.


C#
if(int i=0;i<str.length||i><str.length;i++)>
{
//code here.
}


i wantresult,

loop 5 times repeat but str2 cant assign null values last 2 index.

By mohan
Posted
Updated 23-Dec-11 5:14am
v2

1 solution

If the size of the array is 3 you cannot refer to 4th and 5th elements without first extending the array.

For simplicity, I'd suggest that you would use List[^] instead of an array. Adding, deleting etc. would be much more easier.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900