forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

[Tut.] C++ : Making your first console window

Ok it seems alot of people are interested in taking up c++ to make dlls for ds2 , here is a small tut. to get you started with c++

to get Dev C++ compiler : http://www.bloodshed.net/download.html

Open Up whichever Compiler you will be using (i use ms visual c++).
Create a new console Application (win32 is the same as a console application)

If the following Code is not in your Starting code already then put it in

#include <stdlib.h>
#include <iostream.h>
#include <string>
using namespace std;

int main(int main(int argc, char *argv[]))

{
system("PAUSE");
return 0;
}

Ok now go to the first Bracket and hit enter twice to start a line under the bracket.

then Type the following

cout << "hello i am your computer talking" << endl;

Now your code should look like this

#include <stdlib.h>
#include <iostream.h>
#include <string>
using namespace std;

int main(int main(int argc, char *argv[]))

{

cout << "hello i am your computer talking" << endl;

system("PAUSE");
return 0;

}

Now all you have to do is Build and compile then run it and a dos window should appear saying

"Hello , I am your computer talking"

Summary :

the command 'cout' tells the computer that you want to output some data through the console.

The 2 less than sign following the cout tell the computer that the thing that follows will be shown on the console.

The double quotes are to tell the computer where the string will start and end.

And Endl; means that you want to start a new line.

Hope this helped Some of you soon-to-be programmers on your way of learning, I will Be making a tutorial soon on how to make the console add,substract,multiply or divide numbers.

-Dan

Sharkull's picture

I'm moving this and the other C++ tutorial to the OT forum... because the Tutorials, Tips, and Tricks section is really intended to be used for DS/DS2 related content.

I appreciate the effort Akimoko (and I don't want to discourage your participation in these forums) but the truth of the matter is that there is a ton of this stuff around too... Googling "c++ tutorial" gave me tons of useful resources, like this one:
http://www.cprogramming.com/tutorial/lesson1.html

True, I allowed the c++ tutorial in my DS2 Scripting and Programming forums, since I have many sections. I can link learning c++ to writting a dll or a tool for ds 2. That's my logic behind that. I also wanted more talk about code and such. I may end up making a game dev site linked to Siegecore in the future. There are many tuts on c++ and plan to make a sticky for em when I get to it. I don't mind custom ones. For ds2 dlls you will need to use m$ visual c++ 6 . Correct me if any other compilers work for writting ds2 dlls.

Sharkull's picture

If I thought this was leading to ds2dll's I would have left it where it was... but I really don't think that's the case (so IMO it belongs here, in the OT forum).

I agree with you for STD, since the tut/mod sections are broad, and it's best not to have ds2 information cluttered.