slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
C # Introduction Part 1 PowerPoint Presentation
Download Presentation
C # Introduction Part 1

Loading in 2 Seconds...

play fullscreen
1 / 36

C # Introduction Part 1 - PowerPoint PPT Presentation


  • 64 Views
  • Uploaded on

C # Introduction Part 1. Which Visual Studio Should I use?. Any express (2010, 2012, 2013…) VS for Desktop Any full version. Which Visual Studio Should I use?. Any Express (2010, 2012, 2013…) VS for Desktop Any full version. .Net framework. Class Libraries … Console.ReadLine MSIL CLR.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'C # Introduction Part 1' - azura


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
which visual studio should i use
Which Visual Studio Should I use?
  • Any express (2010, 2012, 2013…) VS for Desktop
  • Any full version
which visual studio should i use1
Which Visual Studio Should I use?
  • Any Express (2010, 2012, 2013…) VS for Desktop
  • Any full version
net framework
.Net framework
  • Class Libraries …Console.ReadLine
  • MSIL
  • CLR
helloword scope method main white space
HelloWord, scope {}, method, Main, white space

using System;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Threading.Tasks;

namespace First

{

classProgram

{

staticvoid Main(string[] args)

{

Console.WriteLine("Hello World!");

Console.ReadLine();

}

}

}

ide projects solution s debug and release mode
IDE, Projects, solutions, debug and release mode, …

C:\Users\<yourname>\Documents\Visual Studio 2012\Projects

.sln(open using Notepad -> it is xml)

Look at using .csproj

compiling

C#

.NET languages

Compiling

C/C++

old languages

code.cs

code.vb

code.cpp

C# compiler

VB.NET compiler

Intermediate

Language (MSIL)

+ metadata

Assembly language

compiling

Common

Language

Runtime

(CLR)

JIT compiler

Machine language

.exe

Machine language

.exe

command line compile and execution
Command Line compile and execution
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  • csc.exe
  • cscProgram.cs
comments intellisense
Comments, IntelliSense

// . . .

/*

. . .

*/

data types variables
Data Types, variables

x = 2

y = x + 1;

Console.WriteLine(y)

3

Need Variables

primitives though they are objects http msdn microsoft com en us library ms228360 v vs 90 aspx
Primitives (though they are Objects)http://msdn.microsoft.com/en-us/library/ms228360(v=vs.90).aspx

String

object

king system object
King System.Object

char

int

string

is operator will be later again
isOperator* (will be later again)

staticvoid Main(string[] args)

{

intmyInt = 5;

TestIsOperator(myInt);

stringmyString = "5";

TestIsOperator(myString);

Console.ReadLine();

}

privatestaticvoidTestIsOperator(Objectobj)

{

if (objisint)

{

inti = (int)obj;

Console.WriteLine("Integer received");

}

elseif (objisstring)

{

stringi = (string)obj;

Console.WriteLine("String received");

}

}

}

ex float and decimal again later
Ex: float and decimal* (again later)

using System;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

namespaceDoubleVsDecimal

{

classProgram

{

staticvoid Main(string[] args)

{

double a = 0.2f;

double b = 1.0f;

Console.WriteLine("{0}", a - b);

decimal c = 0.2m;

decimal d = 1.0m;

Console.WriteLine("{0}", c - d);

Console.ReadLine();

}

}

}output:

-0.799999997019768

-0.8

back to our example using integer data type
Back to our example: using integer data type

int x = 2;

int y = x + 1;

Console.WriteLine(y);

case sensitive language
Case sensitive language

stringmyName;

myName= "Andrew";

Console.WriteLine(myName);

stringmyname = "Alice";

Console.WriteLine(myname);

one line

introducing var
Introducing var
  • Don’t be afraid

varmyName1 = "Bill";

conversion again again later c is a strongly typed language
Conversion again* (again later). C# is a Strongly Typed Language

string s = "Angie";

inttimes = 100;

Console.WriteLine(times + s);

string ok = times + s;

intbad = times + s;