• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

C++ programming.

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
Hey,guys...This is thread has nothing to do with wc3 or even wc3 editor at all,i just mentioned that to let you know that this is completely OFF-TOPIC.

I need some help to find a C++ complier,or anything else that will help me this programming language.Usefull tutorials would help a lot.
I want to download it for free...

I will give +rep to anyone who helps.

P.S. If mods think this an abuse the off-topic section,they can go on and delete the whole thread.Thanks for your time :)
 
Level 17
Joined
Sep 8, 2007
Messages
994
I found the link....here is what GhostWolf suggests:http://www.hiveworkshop.com/forums/pastebin.php?id=f4hm61
EDIT:+rep for you too Yixx.
And... xxdingo93xx what you suggested has a 10 day evaluation time...so i don't think it will do.
Trying raid1000 link.

lol, it is not up to me which link you click. If you just checked one of these links and got only an evaulated version what about checking the other links? <.<
Searching helps, dude.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
That would be Microsoft Visual C++ 2008 (Express Edition).

You can try Dev-C++ or CodeBlocks.

Yes,i've downloaded them both.I'm learning the basics at the moment.
Thank you guys :)

EDIT:I try this

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}

But whenever i run it and want to see the result a get a black screen which disappears in 0.01 sec.How can i make it last longer?
I did this in Dev-C++.
Can someone explain me how CodeBlocks works?
And return 0; what is supposed to mean?
 
Last edited:
Level 12
Joined
Dec 10, 2008
Messages
850
I'm reading this tutorial on C++ right now. It seems pretty good, I learned abit from it in the summer, but my Microsoft Visual C++ trial ran out.

How are you even getting your's to apear? I have the exact same lines, but it wither wont compile properly or it doesn't apear at all.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
reason_3, return 0; just means that you're ending the main function and returning the value 0. The reason why you don't see anything is because there is no pause between the Hello World and the function's return. Try adding "system("pause");" in between them. What that will do is add a "Please press any key to continue..." message, which will accomplish just that. There are some other functions you could use to pause, but I only remember system("pause"). In fact, you'd be better off doing this:
Code:
cout << "Hello World!" << endl;
system("pause");
return 0;

The 'endl' will make a new line, so you don't get "Hello World!Please press any key to continue..."

reason_3 said:
Can someone explain me how CodeBlocks works?
What do you not understand? It's very straightforward in that it gives you wizards for just about everything.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I'm reading the same tutorial Coolty44 and i have managed to make it work.Instead making it display only a message(which runs in nano seconds) and disappears very fast from screen try this...Something in which you will have to "write back" to the program.
include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter price: ";
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: ";
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity <<
endl;
return 0;
}

And HINDYhat i am having trouble on how making it work.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
You know that you are currently using no c++ at all, right?

To explain you, you use C, C++ is just a very much "updated" C, which supports classes, parent classes, child classes and much much more, this is for example C++:
Code:
class Bla{
public:
int result;
int 1, 2, 3;

void Calculate(){
result = 1*2*3; 
}

};

void main{
  Bla new;
  new.1 = 2;
  new.2 = 3;
  new.3 = 4;
  new.Calculate();
  printf("%i", new.result);

}

I hope I made no mistakes, got no editor at home :p.

P.S: I just let the includes away. :) thats intended, it is just a example.

If you want to test it by yourself, include above the class:

#include <stdio.h> or "stdio.h" (don't remember which it was)
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I'm learning it at the moment redscores ...
And i have some questions.
Let's say i want to cout a message.How can i have pause intervals betwneed some messages?For example,
Hello,all!
(wait 3 sec)
I'm a computer!
(wait 5 sec)
How are you?

Or maybe like the letters are typed slow...i mean when you run the prog letter being typed,and not all of them are already typed.
Like H (wait 0.1 sec) e (wait 0.1 sec) l and so on...
 
PHP:
include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter price: "<< endl;;
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: "<< endl;;
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity << endl;
system("PAUSE")
return 0;
}
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
PHP:
include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter price: "<< endl;;
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: "<< endl;;
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity << endl;
system("PAUSE")
return 0;
}

What is this supposed to do?And in what is it different than the one i posted above?Also i get a lot of compile errors with this.
 
What is this supposed to do?And in what is it different than the one i posted above?Also i get a lot of compile errors with this.

The compile errors are your own, I did that in notepad. I just added endlines and system("pause") since you were complaining it ended to fast.

I'm feeling nice and I compiled it correctly;

PHP:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main () {
    string mystr;
    float price=0;
    int quantity=0;
    cout << "Enter price: ";
    getline (cin,mystr);
    stringstream(mystr) >> price;
    cout << "Enter quantity: ";
    getline (cin,mystr);
    stringstream(mystr) >> quantity;
    cout << "Total price: " << price*quantity << endl;
    system("PAUSE");
    return 0;
}
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Yes C is much easier but C++ is better...
*For certain, very terrible values of better.

Yeah, it can be done, and obviously some people can do it. I just don't suggest it as a first language. :p
Remove first and your sentence is perfect. I don't see why you would use C++ unless you are really determined to work at a company that requires it.

--

I would suggest MinGW since gcc is rather popular, if you really insist on using the abomination that is C++.
 
I would suggest MinGW since gcc is rather popular, if you really insist on using the abomination that is C++.

Unfortunately a lot of large libraries only have versions for VC++. Such as PhysX, I believe.

Either they make libraries for all of the compilers or they just make one for VC++. Which is a shame, because VC++ sucks. :/
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Purple, OOP is the future.... that is the truth, nearly every game nowadays uses C++ + other programming languages.
C++ is OOP in the vaguest sense of the word at best. Also, I have nothing against OOP--I'm currently doing work in cLISP with a tad of Java on the side. The non-OOP languages I'm working in, in fact, are Scheme for class (which I prefer cLISP to) and C out of interest.

Also, you are making an argument based on the language's popularity, which is bullshit since momentum is the only (or at least very large main) reason C++ is still alive.

Unfortunately a lot of large libraries only have versions for VC++. Such as PhysX, I believe.

Either they make libraries for all of the compilers or they just make one for VC++. Which is a shame, because VC++ sucks. :/
Try taking away the V from all those statements and it makes a lot more sense.

Really, why there are people out there that actually like C++ is beyond me.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Well,i was thinking creating something like a new game,i heard that C++ is able to do it,and it is high level programming language.
Until now i only had knowledge of "let's say the easiest" languages like Pascal.

Maybe you could do me a favour PurplePoot?I realize you have a great knowledge about programming so can you post a list of the best programming languages and what each one of them is best suitable at?

I would really appreciate it!Thx,+rep!
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
A simple 2d game would be much easier to code in Python or even Java.

An ASCII game could be done in C relatively easy as well.

You would not be doing a 3d game, so that's fine.

Also, it's hard to list the "best" programming languages, but if you are interested in learning a few, I would suggest:

Some dialect of LISP (Scheme probably for simplicity etc).
Strengths: Homoiconic syntax, very simple, rapid development, few gotchyas, a look at functional programming, very powerful, very different from anything else you will likely see.
Java
Strengths: Fairly easy to learn, common, large standard library making it easy to do most common things, excellent web interfacing and documentation.
Python
Strengths: Easy to learn, rapid development, few gotchyas, excellent documentation, large friendly community, large standard library.
C
Strengths: Fast, low-level, extremely powerful, interfaces well with operating systems.

(Note: This is by no means an exhaustive list, nor are the "strengths" sublists)

C++ is really only viable if you want to go into a job which requires it for whatever reason.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Adding random crap and removing the concept of context-free grammar may be an upgrade but it makes the language worse, not better.

Dev C++ supports C too,so i might use this...Another question.
How to remove the "Please press any key to continue..." message ?
I guess its due to system("pause"); i use.Maybe i could replace this with something else?
 
Level 12
Joined
Aug 31, 2008
Messages
1,121
C++ is a major bitch, because everything is so based on how much memory it takes up, and not just its value.(Like there is like 8 types of number types, all just for bigger and smaller, negative and positive numbers.)
Otherwise, I like the syntaz of C++. It is pretty clean on some level, unlike certain languages I've seen.
I loathe my code blocks!
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Syntax in most languages is nothing of any particular note. There are a few exceptions to this (for example, the LISP's family with their macros) but generally syntax isn't a big deal. After you learn a few it becomes much more "yeah, whichever". The important thing is how fast you are able to develop in the language, and no, set foo = bar and foo := bar are not "slower to code" than foo = bar because the latter has a few less characters.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
I like C, and I like C++ too. I've tried Java as well, and I still stick with C++. It's great, and especially for Win32 it's got great potential. Java's nice too, but it's overkill to use it for small apps, because of the way JRE handles it (VM takes up way too much memory), plus you need JRE in the first place.
 
Status
Not open for further replies.
Top