Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

ToString correto em Struct

using static System.Console;

public class Program {
	public static void Main() => WriteLine(new Cores(80, 20, 160));
}

struct Cores {
	public byte R { get; }
	public byte G { get; }
	public byte B { get; }
	
	public Cores(byte r, byte g, byte b) {
		R = r;
		G = g;
		B = b;
	}
	public override string ToString() => $"{R}, {G}, {B}";
}

//https://pt.stackoverflow.com/q/236022/101

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.