Char gösterici ile string tanımlama
string str; unsafe { Console.WriteLine("Char gösterici ile string tanımlama"); char[] text = new char[] {'Y','o','l','u','n','S','o','n','u'}; //fixed bloğu boyunca text değişkeninin adresinin değişmemesini garantiye alıyoruz fixed (char* p = text) { str = new string(p); } Console.WriteLine(str); }
Çıktı:
Char gösterici ile string tanımlama YolunSonu