giza123 (03-15-2011)
Start a console app project and add this code inside the namespace
- Creating the class called Output
- Declaring two strings the will hold our textCode:class Output
- Creating a method called Output and declaring two new strings that will hold the text that will be outputted.Code:string myString; string nextString
- Creating the method that will allow us to print (we will call this later)Code:public Output(string inputString, string input2String) { myString = inputString; nextString = input2String; }
Code:public void print() { Console.WriteLine("{0} {1}", myString, nextString); }
So far you should look like this:
Code:class Output { string myString; string nextString; public Output(string inputString, string input2String) { myString = inputString; nextString = input2String; } public void print() { Console.WriteLine("{0} {1}", myString, nextString); } }
Next add this:
Code:class program { public static void Main() { Output Out = new Output("First one", "Next one"); Out.print(); Console.Read(); } }
This snippet is declaring the class Output as a new name, out. It is setting it equal to Output with two strings.Code:Output Out = new Output("First one", "Next one");
Now we call our print function which will display "First one Next one" on the screen. console.Read(); just holds it on the screen.Code:Out.print(); Console.Read();
Your finally code should look like this:
If I was of any help press thanks, if you have any questions please post them.Code:class Output { string myString; string nextString; // Constructor public Output(string inputString, string input2String) { myString = inputString; nextString = input2String; } public void print() { Console.WriteLine("{0} {1}", myString, nextString); } } class program { public static void Main() { Output Out = new Output("First one", "Next one"); Out.print(); Console.Read(); } }
[IMG]https://i516.photobucke*****m/albums/u330/richdude212-2.jpg[/IMG]
[IMG]https://i516.photobucke*****m/albums/u330/richdude212/leet.gif[/IMG]
Get NX Cash For Completing Offers Here! (will redirect)
Remember to press
when people help you!
Not bad for $14.99 a month...
giza123 (03-15-2011)

918
Not very well explained really. No mention of what a constructor is or does (you just said make a method called Output..lol), sorta just copy and paste this and voila you have a class. More detail is needed because this is a fundamental in programming, it's necessary to explain it properly so people don't get the wrong impression at the very start of their programming career. My Java lecturer was explaining classes the other day and he did a good job (despite the fact that I nearly fell asleep with boredom) explaining all about instance variables, access modifiers, constructors, methods...etc. You need to actually go into some detail for this to count as a tutorial.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Hell_Demon (03-15-2011)
Last edited by ♪~ ᕕ(ᐛ)ᕗ; 03-15-2011 at 10:05 AM.

918
You even know what you're talking about?.
If you actually bothered to read my post, I said classes were a <let me highlight the import parts for your selective reading>
FUNDAMENTAL ASPECT of learning to program, i.e you LEARN THEM AT THE BEGINNING WHEN YOU DON'T KNOW AN INT FROM A STRING so special attention must be given to ENSURE THE NEW PROGRAMMER UNDERSTANDS WHAT A CONSTRUCTOR IS, WHAT A METHOD IS, WHAT ACCESS MODIFIERS DO, HOW TO CONSTRUCT A NEW INSTANCE OF THE CLASS AND CALL IT'S METHODS.
Shit man, I didn't have any trouble understanding it either, but...oh wait... I already know how to program. Of course it's easy to understand if you know how to program, fuck sake.
Last edited by Jason; 03-15-2011 at 11:17 AM.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
B1ackAnge1 (03-22-2011)

918
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)

918
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
O_O im still learning c++ sooo this needs to be explained a little more![]()
[YOUTUBE]<iframe title="YouTube video player" width="195" height="140" src="https://www.youtube.com/embed/j5-yKhDd64s" frameborder="0" allowfullscreen></iframe>[/YOUTUBE]
thanks kinda helped