More C# stuff

csc First.cs // compiling

variables must be declared before using.

var a=”123″; // will automatically infer variable as a string

In a for loop, you can have a “throw away” counter variable

for (int i=0; i<10; i++) {

Console.WriteLine(i);

}// end of for, i fell out of scope

int is 32 bit

float is 32 bit

bool is true/false

char is unicode char 16 bits

string is unicode character string

object is the parent of all objects. Has a bunch of methods like ToString() for example.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s