automatic memory handling lots of libraries Why use Visual C# most code written for you desktop applications internet applications cross-platform object-oriented programming web+cloud services embedded systems
Variables types & declaration • Supported types: integers, doubles, strings, dates and many more • Declaration: [type] name = [value]; • Example: string name="Konstantinos"; • Important: Assign with one = compare with two == • Don‘t forget to initialize your variables!
• Same logic as in mathematics: = 22 + 3 + 5 • Function declaration: [type] function_name ([type] arg1, [type] arg2,…) { statements; } Functions and methods the basics
Control statements if clauses • if (condition) statement1; else statement2; • if (condition1) statement1; else if (condition2) statement2; else statement3; Example int age; boolean legalAge; if (age>=18) legalAge=true; else legalAge=false;
for (int i = 1; i <= 5; i++) { Console.WriteLine(i); } int[] array={3,7,1,9}; foreach(int num in array){ Console.WriteLine(num); } Loop statements for and foreach
• .NET Framework 4.5 support • Simpler asynchronous/threaded programming with the async and await keywords • Quicker debugging with Caller Information • Windows Store application support What’s new in Visual C# 2012
• Support for Visual C#, Visual Basic, Visual F#, C, C++, ASP.NET, XNA • Complete development environment for major platforms including Windows desktop, Windows Store, Windows Phone, ΧΒox • Provides all the tools you might need to create pro-level applications Visual Studio
• New look and feel including a dark theme (yay!) • Better faster IntelliSense • Support for .NET Framework 4.5 and Visual C# 2012 • Ability to develop for Windows Store and Windows Phone 8 • Blend for Visual Studio included Key new features
• Microsoft Developer Network: msdn.microsoft.com • Visual C# in Visual Studio resources: http://bit.ly/OJFzDr • Active community at StackOverflow • StudentGuru: www.studentguru.gr • Contact us!! Visual C# Resources