Compile Crazy
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePortalLatest imagesSearchRegisterLog in

 

 C# for beginners :)

Go down 
3 posters
AuthorMessage
triclops200




Posts : 6
Join date : 2010-08-16

C# for beginners :) Empty
PostSubject: C# for beginners :)   C# for beginners :) I_icon_minitimeMon Aug 16, 2010 4:05 pm

C# is a very easy to use OOP (Object Oriented Programing) language. It is very powerful and very fast, despite it being tied to .net. lets just do the simple hello world for now and I'll post more complex tutorials later Smile.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace helloworld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
    }
}

okay let's break it down Smile
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
this is the place where you define what the code will use to run. if you were to need to use network stuff you would add:
Code:
using System.Net;
now for the next bit.
Code:

namespace helloworld
{
    class Program
    {
your namespace is where you define your classes that your program will use, namespaces of the same name can be spread over multiple files and the classes under the same namespace will be accesable inside of the whole namespace. classes are containers of variables and functions which are used for your code.
Code:
 static void Main(string[] args)
        {
This is where the program starts(Always in the Main() function), it is also a function definition. A function is a system of commands that can be called at any point within the same class. (or outside of the class, but that is a little harder and for a future lesson).
Code:
Console.WriteLine("Hello World!");
            Console.ReadKey();
Console.Writeline() is used to write an output to the console and then add a new line after that. Console.ReadKey() is just used here to pause the program so you can see the output.
your done, compile and see the results Smile.
Back to top Go down
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeWed Aug 18, 2010 6:45 pm

Thank you for this, triclops! This is the kind of knowledge and ability I was hoping to attract to CC when I posted on the PT forum! Interestingly, minus the namespace declaration, this looks frighteningly similar to Java. Shocked
Back to top Go down
triclops200




Posts : 6
Join date : 2010-08-16

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeSat Aug 21, 2010 3:23 am

thank you Smile, and I dislike Java Razz. but I will post a step 2 tutorial tomorrow.
Back to top Go down
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeSat Aug 21, 2010 7:27 pm

Yeah, I don't like Java either. Razz Unfortunately, the language on the AP test, for my computer programming AP course, is Java, so I have to work with it. I normally work with, and prefer, Python.Smile
Back to top Go down
Compu-Teck Inc.




Posts : 80
Join date : 2010-04-29
Age : 31

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeTue Aug 24, 2010 1:40 pm

I also prefer Python. It is actually the language I am working with. I have just started OOP in Python Very Happy
If anyone wants to learn Python, check out my tutorials in the Python section (located above this in the For Beginners).

(P.S. I do not know anyone that likes Java Razz )
Back to top Go down
triclops200




Posts : 6
Join date : 2010-08-16

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeTue Aug 24, 2010 1:44 pm

Sorry, I've been busy lately, I will post a tut ASAP, but right now I have a lot on my plate.
Back to top Go down
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeTue Aug 24, 2010 10:11 pm

Just get to it when you're able, triclops. I understand having a lot on one's plate. Personally, my class load is nuts this year Shocked, so I can definitely relate!Smile
Back to top Go down
triclops200




Posts : 6
Join date : 2010-08-16

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeWed Aug 25, 2010 4:35 am

lol, two-a-day football training eats up my time, then school next week. maybe this weekend.
Back to top Go down
Compu-Teck Inc.




Posts : 80
Join date : 2010-04-29
Age : 31

C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitimeThu Aug 26, 2010 1:38 pm

Well, maybe I can finally learn some C# from someone who actually knows what they are talking about! Laughing kidding! seriously, good job here, triclops.
Back to top Go down
Sponsored content





C# for beginners :) Empty
PostSubject: Re: C# for beginners :)   C# for beginners :) I_icon_minitime

Back to top Go down
 
C# for beginners :)
Back to top 
Page 1 of 1
 Similar topics
-
» JavaScript for beginners
» XHTML for beginners

Permissions in this forum:You cannot reply to topics in this forum
Compile Crazy :: Programming :: C Family :: C# :: For Beginners-
Jump to: