Jump to content
  • Advertisement
Sign in to follow this  
hotpixel

Real beginner question about C++

This topic is 3729 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What happens when you have a structure that is used in two classes? How do you get around Visual Studio complaining all the time about redefinition of structures in header files? And how do you stop it from entering an infinity loop because one header is included in another which links back to the first but is needed because it contains the structure??? Thanks, Andy

Share this post


Link to post
Share on other sites
Advertisement
Awesome, fixed my problem! I didn't know about forward declarations, considering I got taught this stuff at uni I'd say it was a pretty big thing to leave out!!!

Share this post


Link to post
Share on other sites
Yes, you'll often find that most courses and classes on C++ are lacking in many, many ways.


You can look forward to several of these moments, where you find that your presumptions and your knowledge is seriously lacking and you have no idea what is wrong.

One of the worst, in my opinion, is copying of objects which use new and has delete in its destructor - that's heavy stuff to work out when you have no idea what's wrong or where it happens.

Just keep on going and don't give up - you're over a nasty hurdle already!

Share this post


Link to post
Share on other sites
Quote:
Original post by CodeLuggage
Yes, you'll often find that most courses and classes on C++ are lacking in many, many ways.


You can look forward to several of these moments, where you find that your presumptions and your knowledge is seriously lacking and you have no idea what is wrong.

One of the worst, in my opinion, is copying of objects which use new and has delete in its destructor - that's heavy stuff to work out when you have no idea what's wrong or where it happens.

Just keep on going and don't give up - you're over a nasty hurdle already!


Yeah when you first try to make a copy constructor for your classes without using references and they go into infinite recursion is an eye opener!

Share this post


Link to post
Share on other sites
Well I started in C++, I developed my final year project at uni in it using stereoscopic goggles and a wearable computer. What I did in C++/DX was pretty crude but the surrounding technology made it pretty impressive.

I then decided to back track and try to get my head around the more complex stuff in C#, HLSL, vertex shaders, pixel shaders, vertex buffers, animations, matrices etc once I had a nice looking environment in C# and I could actually understand some of the complexities of DX I then thought it was a good idea to move onto C++ and now I'm trying to master the complexities of that. I've converted most of my project and I'm amazed that it runs 200fps faster but looks exactly the same!!!

I'm not new to programming, I've been doing it for over 7 years now, .NET, Java, PHP, VB, Lingo, AS3 but C++ really is a different ball game to all those!

It makes me laugh when I remember my lecturer saying, "C++ is pretty much Java, same syntax you've just got these pointer things"!

Share this post


Link to post
Share on other sites
Quote:
Original post by hotpixel
Well I started in C++, I developed my final year project at uni in it using stereoscopic goggles and a wearable computer.

Did that help improve your code quality? I find good coffee and hard trance music helps me, but to each his own.

Share this post


Link to post
Share on other sites
LMFAO!

Here I am with a gigantic mug of coffee, listening to "Techno Radio ! Deep Electro Music Live From Paris France - Powered By RadioABF.net" and programming my project.

I don't know if you've ever used stereoscopic goggles but they are awesome, you pay out your nose for them but the experience is immense. You find the user is so wrapped up in the experience that they don't realise your game code is sh*t.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!