• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

C++

Status
Not open for further replies.
Level 15
Joined
Feb 9, 2006
Messages
1,598
I'm currently trying to learn C++, Following a tutorial I downloaded. Well, I need help. I'm stuck, due to my poor english and lack of IQ I supouse : p

Nah, but could you tell me if you know C++ And then If you do, I would tell you my problems : p

Thx

~Operator
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
I know C/C++. If you have specific error messages or a specific block of code, post it here and I'll try to help. :smile:
 
Level 15
Joined
Feb 9, 2006
Messages
1,598
Well, it's not an error....

I made this simple program/code following a tutorial:

''
#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}
''
Now, how do I run this program in CMD ? Or is it another way to run it ?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Hehe... I think I found the mistake. It's "#include <iostream.h>", you forgot the "h" (atleast that's how my borland C++ compiler behave). And I don't get why you make main return a value. You could actually make it of type "void" and then you would not have to worry about returning a value from it.

Final program?

Code:
#include <iostream.h>
void main()
   { cout<<"Hello World"; }

Cheers!

~Daelin
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
Hehe... I think I found the mistake. It's "#include <iostream.h>", you forgot the "h" (atleast that's how my borland C++ compiler behave). And I don't get why you make main return a value. You could actually make it of type "void" and then you would not have to worry about returning a value from it.

Final program?

Code:
#include <iostream.h>
void main()
   { cout<<"Hello World"; }

Cheers!

~Daelin
iostream should not have a .h on it, at least not in libc under Linux and Microsoft's library in Windows.
This is correct:
#include <iostream>


oh, well I just followd my tutorial :) Thx, anyway

But I didn't get an answer to my question. How do I run it ? Cuz saving it as .exe does not solve it :p
You need to compile the code first. Compiling your code will generate a .exe file that you can run. :smile:
 
Last edited:
Level 15
Joined
Nov 1, 2004
Messages
1,058
To help you further, I need to know:

What development program do you use? (Microsoft Visual Studio? Dev-C++? Eclipse?) Or are you just typing code in a text file and wanting to compile that?
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
Level 36
Joined
Mar 15, 2006
Messages
7,945
I would recommend XNA game studio, by Microsoft, which is an addon that goes with Visual C# I think. One of the C languages anyway. It's easy to use, has a lot of documentation, and sort of like dreamweaver if you've ever used it, it has a design window (where you can actually drag and drop buttons and things and it writes the code in for you), and a coding window (where you can do all of the rest of yoyur programs functions yourself. I found a very easy tutorial that allowed me to make a simple program so that when you click a button it changes a text field to a certain value.
 
Level 36
Joined
Mar 15, 2006
Messages
7,945
C++ is a good coding language used for a lot of professional stuff. For example, WC3 was probably coded in a C language of some kind. C++ is used by a lot of game developers because it is an object oriented programming language. Which is a good thing. If you wanna work as a coder for a game company then you usually have to know a C language fluently if you want the job.
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
Based on how quickly Blizzard makes games, I wouldn't be surprised i fit took Blizzard 5 more years before they released a Warcraft 4 game. But when it did come out, it would be amazing as usual.
 
Status
Not open for further replies.

Similar threads

Top