Open Side Menu Go to the Top
Register
Looking for info on C++ Looking for info on C++

03-07-2012 , 12:35 PM
do you guys think SDL or SFML is easier for a beginner to learn? also thanks, i learned a bit of java and im surprised how similar to c++ it is. it almost feels like plagiarism lol
Looking for info on C++ Quote
03-07-2012 , 04:46 PM
Quote:
Originally Posted by Ryanb9
do you guys think SDL or SFML is easier for a beginner to learn? also thanks, i learned a bit of java and im surprised how similar to c++ it is. it almost feels like plagiarism lol
They are not really similar at all, except for syntax..
Looking for info on C++ Quote
03-15-2012 , 12:36 AM
This is a little silly but why did they do it like this:
int * pNumber1 = &Number1 ;

When this would make more sense (imo):
int * pNumber1 = @Number1 ;

Because of this:
int & refNumber1 = Number1 ;
int * pNumber1 = &refNumber1 ;

It is making me confused because it doesn't seem consistent.
Looking for info on C++ Quote
03-15-2012 , 06:17 AM
I agree, it is confusing. Not sure why they did it that way. Incidentally, in Pascal, @ is used as the "address-of" operator.
Looking for info on C++ Quote
03-15-2012 , 09:50 AM
Quote:
Originally Posted by Ryanb9
This is a little silly but why did they do it like this:
int * pNumber1 = &Number1 ;

When this would make more sense (imo):
int * pNumber1 = @Number1 ;

Because of this:
int & refNumber1 = Number1 ;
int * pNumber1 = &refNumber1 ;

It is making me confused because it doesn't seem consistent.
Because C++ was designed to be C compatible and references were added in C++. It was probably a design decision to minimize new syntax.
Looking for info on C++ Quote
03-15-2012 , 12:39 PM
Okay thats actually good news because I was afraid that I was missing something but it looks like it's just supposed to be a little weird.

Hmm.. also xD Is there a real difference (in C++ terminology I guess) between and object and an instance? I have searched for this answer at least 3 times over the last week and everywhere I go I see people claiming different things for what it means. (and by real I mean accepted by... most people and not just true for different clicks or w/e)

edit: and for that matter, I cant even tell the difference between a class and what a lot of people say is an object.
Looking for info on C++ Quote
03-15-2012 , 02:15 PM
Object and instance are the same thing. An object is an instance of a class.
Looking for info on C++ Quote
03-15-2012 , 03:09 PM
Quote:
Originally Posted by sensAAtion
all that you want to know is here : c++

enjoy
I'm trying to upvote this answer
Looking for info on C++ Quote
03-15-2012 , 04:11 PM
@Ryanb9: I just read through the thread, including downloading your original blackjack.txt. Your code improves with each new update and it looks like you are making really good progress. Congrats!

As far as books, there are several classic books on programming practices that I would recommend. They aren't specific to any language, more a higher level view of how to approach coding. I really wish I had read them at the beginning of my programming journey, and I think they can help immensely to show you the right way to do things early (otoh, don't be too nervous about developing bad habits: as long as you are asking how you can improve I don't think bad habits are hard to break. It's people who think they know what they are doing and have nothing more to learn that are dangerous.)

Any (or all!) of these books would be a great read at this stage:

The Pragmatic Programmer: From Journeyman to Master - Andrew Hunt & Dave Thomas
Code Complete: A Practical Handbook of Software Construction - Steve McConnell
Clean Code: A Handbook of Agile Software Craftsmanship - Robert C. Martin
Refactoring: Improving the Design of Existing Code - Martin Fowler

And I second (or third, or fourth) the recommendation for http://stackoverflow.com and also the related http://programmers.stackexchange.com/
Looking for info on C++ Quote
09-02-2014 , 04:55 PM
Sorry to bump but interesting read since I am starting in c++ at my community college. Haven't bought a book yet since the class doesn't mandate any. However I am still thinking of getting c++ primer as a supplement to the class.

Also any updates from OP? He must be a pro by now
Looking for info on C++ Quote
09-02-2014 , 05:44 PM
Quote:
Originally Posted by Barrin6
Sorry to bump but interesting read since I am starting in c++ at my community college. Haven't bought a book yet since the class doesn't mandate any. However I am still thinking of getting c++ primer as a supplement to the class.

Also any updates from OP? He must be a pro by now
That's a good book, you probably won't delve into the final 1/3 of the book in much detail in the class.
Looking for info on C++ Quote
09-02-2014 , 06:24 PM
Quote:
Originally Posted by sng_jason
Sure, even in very good game engines, there might be class/structs to encapsulated "objects"... but as you suggested, virtual calls are a big no-no.

But even beyond those things that create very poor machine code (e.g. vtables, RTTI, exception handling, etc... ), typical OO design philosophies are often at odds with the realities of modern computer architectures. In particular I'm talking about the gulf that has developed between CPU processing power and memory bandwidth.

In most non-trivial apps, memory bandwidth has become the most important performance consideration.... and this means that "data access"-centric design beats out object-centric design. For examples, a "structure of arrays" data structure is often the best performance choice but you'd never hear about such a thing from any OO book/whitepaper/class.

An interesting book related to this topic.
Real Time C++: Efficient object Oriented and Template Microcontroller Programming
Looking for info on C++ Quote

      
m