Example #1
0
        static void Main(string[] args)
        {
            BookStruct book = new BookStruct();

            book.title = "Chandan";

            BookClass book1 = new BookClass();

            book1.title = "Chandan";

            Console.WriteLine("BeforeChange\nBook Struct: {0}", book.title);
            Console.WriteLine("Book Class: {0}", book1.title);

            changeValue(book, book1);

            Console.WriteLine("AfterChange\nBook Struct: {0}", book.title);
            Console.WriteLine("Book Class: {0}", book1.title);
        }
Example #2
0
 public static void changeValue(BookStruct bookStruct, BookClass bookClass)
 {
     bookStruct.title = "Dharmesh";
     Console.WriteLine(bookStruct.title);
     bookClass.title = "Dharmesh";
 }