returning arrray from a function
-
Hi Can someone tell me how to return an array from a function??? Regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.
object[] MyFunction() { }
-
Hi Can someone tell me how to return an array from a function??? Regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.
public string[] myfunction() { string[] myarray = {"test","test","Test"}; return myarray; }
topcoderjax - Remember, Google is your friend.
-
Hi Can someone tell me how to return an array from a function??? Regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.
saqib82 wrote:
tell me how to return an array from a function???
But What is the type of the array string[] function() int[] function() IF you don't what will the type then check for Generic new in Dot net Framework
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
saqib82 wrote:
tell me how to return an array from a function???
But What is the type of the array string[] function() int[] function() IF you don't what will the type then check for Generic new in Dot net Framework
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
Haven't handled arrays in generics, but here is an article[^] An excerpt shows this: 23 // output array of all types 24 static void PrintArray< E >( E[] inputArray ) 25 { 26 foreach ( E element in inputArray ) 27 Console.Write( element + " " ); 28 29 Console.WriteLine( "\n" ); 30 }
topcoderjax - Remember, Google is your friend.
-
Haven't handled arrays in generics, but here is an article[^] An excerpt shows this: 23 // output array of all types 24 static void PrintArray< E >( E[] inputArray ) 25 { 26 foreach ( E element in inputArray ) 27 Console.Write( element + " " ); 28 29 Console.WriteLine( "\n" ); 30 }
topcoderjax - Remember, Google is your friend.
Yes but i think the function you have written is similar to genric
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Hi Can someone tell me how to return an array from a function??? Regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.