Computersight > Programming

Programming Basics for Beginners in C#

Giving basic knowledge about programming, in the widely known C# language. If you are interested in learning C#, then I'm going to continue writing about it.

It's a quite young programming language, as a part of the .NET Framework. It's very similar to the Java, but there are some minor differences.

For a beginner, I recommend to use Visual Studio 2008 Express which can be found at Microsoft's website, and downloadable for free.

Programming basics:

I'm going to teach you some basics, which are can be found in several languanges:

Declaring:

There are a few basic types of declaring a variable: it can be public, public static, protected, private, and local, but you will need only three of them right now.

public string example; - public means that it can be used anywhere in the class which it was declared in, the ; symbol means that you gave an „instruction” for the compiler - if you don't give a value, just declare it, it will automatically takes the string.Empty(nothing) value

public static int myvalue; - public static means that it can be linked to any classes - it will automatically takes the 0 value

bool running; - it can be declared inside a void, but you won't have a chance to recall it in another void - it will automatically takes the false value

Basic variables:

string - stores text, for example: public string example = ”This is my example”;

int - stores numeric values, for example: public int myvalue = 22;

it has four types:

    • int8 stores integer numbers from -128 to 127

    • int16 stores integer numbers from -32,768 to 32,767

    • int32 stores integer numbers from -2,147,483,648 to 2,147,483,647

    • int64 stores integer numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

    bool - it has two possible values: true or false, for example: public bool running = false;

    9
    Liked It
    I Like It!
    Related Articles
    Steps to Become a Hobbyist Game Programmer  |  3D Engine Construction and Design Workshop: Lesson 1 - Introduction and Synopsis
    Latest Articles in Programming
    SQL and Databases  |  Why Solidworks?
    Comments (0)
    Post Your Comment:
    Name:  
    Copy the code into this box:  
    Inside Computersight

    Communication & Networks

     /

    Computers

     /

    Hardware

     /

    Operating Systems

     /

    Programming

     /

    Software


    Popular Tags
    Popular Writers
    Computersight
    About Us
    Terms of Use
    Privacy Policy
    Services
    Submit an Article
    Advertise with Us
    Contact

    © 2007 Copyright Stanza Ltd. All Rights Reserved.