Lecture overview -- Keyboard shortcut: 'u'  Previous page: Enumerations types -- Keyboard shortcut: 'p'  Next page: Arrays and Strings -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 9 : 43
Object-oriented Programming in C#
Introduction to C#
Non-simple types

This is about arrays, strings, structs. All the classes and structs that we program ourselves also count as non-simple types.

C# allows for a variety of non-simple types, most important Classes

  • Similarities

    • Arrays in C#: Indexed from 0. Jagged arrays - arrays of arrays

    • Strings in C#: Same notation as in C, and similar escape characters

    • Structs in C#: A value type like in C.

  • Differences

    • Arrays: Rectangular arrays in C#

    • Strings: No \0 termination in C#

    • Structs: Much expanded in C#. Structs can have methods.

  • New kinds of non-simple types in C#:

    • Classes

    • Interfaces

    • Delegates

As an object-oriented programming language, C# is much stronger than C when it comes to definition of our own non-simple types