수업 020 (05.06 2020) Tuple Example

2020. 5. 6. 11:51
728x90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
namespace Study._021_2
{
    class Program
    {
        static Tuple<stringint> getTuple()
        {
            // Return a single value using the tuple.
            return new Tuple<stringint>("Hello"123);
        }
        static void Main(string[] args)
        {
            // Obtain a single entry tuple.
            Console.WriteLine(
            getTuple().Item1 + " " + getTuple().Item2);
            // Wait for user to acknowledge the results.
            Console.WriteLine("Press Enter to terminate...");
            Console.Read();
        }
    }
}
 
cs

>> https://www.dummies.com/programming/c-sharp/returning-multiple-values-using-tuples-c/

728x90

BELATED ARTICLES

more