What's the difference between regular ol' C++ and Visual C++? A lot of video game companies seem to require C++ expertise (that's getting a little ahead), but they don't seem to say anything about Visual.
Announcement
Collapse
No announcement yet.
C++ vs Visual C++
Collapse
X
-
Re: C++ vs Visual C++
But each one is just as capable as the other?
Would Visual C++ 2005 Express Edition be recommended? Seems to be the newest free Visual, but the "Experess Edition" throws me off.Last edited by ErikaFuzzbottom; 05-17-2006, 08:54 PM."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment
-
Re: C++ vs Visual C++
Umm I would just stick with regular C++, if you want to go into games. Since visual C++ is part of Visual Studio, it
A might not be portable
B will likely be slower if it's integrated with .net
C is not widely used (in the games industry at least).
And in terms of capability both would be equal, though you will need to find a windowing library, and you won't get a nice GUI creator with normal C++. Of course if you want this you could try C#, which a lot of people are starting to use for Web Apps since it is part of the .NET framework and is used for backend code of ASP pages. But for C++ you just need to learn the windows libraries (all in <windows.h> I believe), which is not an easy task but I'm sure there is tons of stuff on it around the net, and probably included with Visual Studio and if not on Microsoft.com's developer pages.
Note however that you can program in just regular C++ with Visual Studio, as it does have a regular C++ compiler (which is technically not 100% adherent to C++ standards but I think it was like 99% or something like that). And since the whole reason people use C++ in the first place is speed and to a lesser extent portability, I would go with non-Visual C++. C++ is chosen over C since it contains all the essentials of C and also adds in support for Objects which makes programming a much easier task, as it is much easier to take advantage of code reuse in an Object Oriented Language. Plus it has much stricter type checking which will catch logical errors a C compiler would miss, since C will compile almost anything, even if it might not work.
Now to address PandaMoes comment normal C and C++ with just the base libraries might only be good for Math problems and normal commandline driven apps however to almost anything interesting you will need 3rd Party libraries for stuff. Like OpenGL or DirectX for instance which both work with C or C++ (actually easier to do them in normal C for setting up stuff but you will still want C++ for objects to draw and such) and allow you to create 3D renderers and such. My school also did not teach us much about these mainly because my school focused more on theory and why things work not how to implement them (GA Tech being my school).Last edited by thetruecoolness; 05-17-2006, 09:38 PM.
Comment
-
Re: C++ vs Visual C++
Okay, so now all I have to do is find the newest C++ compiler. I have a book that comes with one, but it's back from '00 and is likely out-of-date at this point."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment
-
Re: C++ vs Visual C++
Not sure if it will work with Windows or not, but might through Cygwin, but the intel compiler is also a good choice http://www.intel.com/cd/software/pro...lin/219856.htm.
Not sure if it will make speed improvements for an AMD processor or not, but using various optimization options it can beat gcc on some things. This article gives a fairly good overview of the options for it http://www.gamedev.net/reference/pro...ping/page2.asp. Though the article was written for reducing ping it also goes over basic optimization and compares ping using gcc and icc (intel C compiler), on intel machines.
Comment
-
Re: C++ vs Visual C++
Bah, this thing keeps telling me I'm using a "Depreciated header" or something like that! I downloaded the files it wanted me to! It keeps pointing to the #include <iostream.h> line also."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment
-
Re: C++ vs Visual C++
Well in C++ the new include scheme is just
#include <header> not
#include <header.h>
So this may be what it is talking about. So try
#include <iostream>
I'm not exactly sure on the details as to why this is different but I know it is. If that fails and you just want to use the normal C io structures and functions (i.e. printf) just
#include <stdio.h>
or
#include <cstdio>
Both are legal ways to include C standard libraries.
Of course I'm still learning C++ myself, since it's hard to get a job in the video game industry as a programmer without knowing it, even if you know other languages and can pick up a new language in a month or less. So I don't know if this will fix your problem but it couldn't hurt.
And as a side note iostream is a system library and should be included in all C++ dev environments, since it is a standard part of the language, like stdio.h, stdlib.h and a couple of others are for C. For other libraries however you will need to have a .h, .lib, and possibly a .dll to use them with your program, and you will need to tell the linker where to find these files (the process for doing this is different for each IDE, but is usually somewhere in project properties).
BTW a good resource for learning the workings of the C++ language is Thinking in C++ Vol1 and 2 by Bruce Eckel (available as a download on his site http://www.bruceeckel.com).Last edited by thetruecoolness; 05-20-2006, 04:41 PM.
Comment
-
Re: C++ vs Visual C++
Well, I already tried simply <iostream>, but then it didn't recognize cout and cin.
The tool recommended that I used -Wno-deprecated to turn off the deprecated warning, though, and it took me a little bit to figure it out how to do that, but I got it to work for me finally. I just hope I won't wind up getting some job programming in C++ and it turns out I can't do the same thing there.
Come to think of it, I didn't even test to see if it'll run the program I created.
EDIT: Yeah, it'll run. It just automatically closes once it reaches the end, so I'm unable to see the results until I run it again. I know there's a command that'll wait for a time or until a button press, but I can't remember it at the moment. This book will get to that option sometime, I assume.Last edited by ErikaFuzzbottom; 05-20-2006, 05:03 PM."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment
-
Re: C++ vs Visual C++
Well I since I own the book the whole include thing was on page 85, not sure how the net version works. The book is meant for people who really want to learn the language and all that is involved with it, if you want to know how to use a certain compiler I would google for tutorials, since a general programming book isn't going to help with that.
Now the reason just cout and cin were not working is because they are in what is known as a namespace (similar to a package in Java if you've ever used Java). So to use cout and cin you have to say std::cout and std::cin, or put the line
using namespace std;
after your include statements, then you can use just cout and cin, because std is now implied by the compiler. If you tried this and it didn't work I'm not sure what is going on there. Namespaces are there to help "package" your library classes, and if you ever wanted to have two classes with the same name but in different packages. You'll probably never really need to use them but it's good to be aware of them for things like this.Last edited by thetruecoolness; 05-20-2006, 05:18 PM.
Comment
-
Re: C++ vs Visual C++
Ah, I hadn't tried the std:: and <iostream> at the same time. Yeah, that works. I'll have to keep this stuff in mind as I learn the language. Glad I looked for an updated version. This book is 6 years old."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment
-
Re: C++ vs Visual C++
Originally posted by thetruecoolnessWell in C++ the new include scheme is just
#include <header> not
#include <header.h>
So this may be what it is talking about. So try
#include <iostream>
I'm not exactly sure on the details as to why this is different but I know it is. If that fails and you just want to use the normal C io structures and functions (i.e. printf) just
#include <stdio.h>
or
#include <cstdio>
Both are legal ways to include C standard libraries.
Ok, the difference is that cstdio just has the C++ methods of doing everything. When the ANSI standards for C++ were being made, they just took all the libraries that were in C ( something.h ) and created a CSomething for it.
I recommend the book C++ Primer Plus in whatever is the latest addition.
Originally posted by DraygoneWell, I already tried simply <iostream>, but then it didn't recognize cout and cin.
This is because cout and cin are ostream and istream objects in iostream, but they are still in the std namespace. To put an object into scope you use the std:: before it. Alternatively, to use a name space, you use a using directive or a using declaration.
I highly advise against using namespace std; It brings a whole mess load of overhead. This isn't bad when you're learning. In fact, it's kind of convenient. But if you planning on making a game, every bit of overhead that is unnecessary must be avoided.
Originally posted by thetruecoolnessMy school also did not teach us much about these mainly because my school focused more on theory and why things work not how to implement them (GA Tech being my school).
Have fun with Java, SQUEEK, Scheme, and Fortran?
My friend from Georgia Tech thoroughly hated how they taught, but then again, he's been programming since he was 8. He's the youngest old school C programmer around.
Originally posted by DraygoneIt just automatically closes once it reaches the end, so I'm unable to see the results until I run it again. I know there's a command that'll wait for a time or until a button press, but I can't remember it at the moment. This book will get to that option sometime, I assume.
There are a few ways to do this. Now, if you don't want to be including new headers and such, try the System funciton and pass it the string "pause". ( system( "pause" ); ). Otherwise, you can include <conio.h> and use the getch() function.
By the way, I do highly recommend Visual Studios. I use it for all my C++ compiling and when I want to make .NET tools, I use C# because it's quick and robust (and who cares about performance for tools). C++ kind of gets the shaft in Visual Studios when it comes to comparable features to the other languages, but it still definitely has the nicest IDE, without plug-ins factored in. And I am a man who loves his plug-ins. It's nice having the compiler count lines, comment for you as well outline the flow of code.
Comment



5198-2124-7210 Smash

Comment