Jump to content
Sign in to follow this  
tips48

Where/How to learn C++

Recommended Posts

Just curious on how you guys learned C++, and just in general any tips. I'd ideally not want to purchase anything like a book, but if you've found that it's a great resource worth my money then I'll consider it.

 

The only other programming language I really know is Java, so i'm fine with OOP. I also understand PHP if it makes a difference

 

Thanks!

- tips

 

EDIT: Sorry that this doesn't really flow, I have the flu and aren't thinking straight :D


treq5.gif

T R Tipster.png

Share this post


Link to post
Share on other sites

If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic.

 

Definitely recommend the book that obfuscator posted.

 

This is a good reference too, I guess: http://www.cplusplus.com/doc/tutorial/introduction/

Share this post


Link to post
Share on other sites

If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic.

 

Definitely recommend the book that obfuscator posted.

 

This is a good reference too, I guess: http://www.cplusplus...l/introduction/

That sounds like a good idea, thanks.

I'll check out the website and book!


treq5.gif

T R Tipster.png

Share this post


Link to post
Share on other sites

If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic.

 

Definitely recommend the book that obfuscator posted.

 

This is a good reference too, I guess: http://www.cplusplus...l/introduction/

I seem to get lost right around in here: http://www.cplusplus.com/doc/tutorial/pointers/


treq5.gif

T R Tipster.png

Share this post


Link to post
Share on other sites

Their guide to pointers isn't very good. Honestly, I didn't understand them at all until they came up in class recently. Just know that their main use is for returning arrays. Google how to return arrays in C++ and you'll probably have a better understanding of them.

Share this post


Link to post
Share on other sites
This may be helpful if you're having difficulty with pointers.

polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

Share this post


Link to post
Share on other sites

The only thing I don't get is why you would want to use the pointer. LIke what advantage is there to passing a pointer instead of just the variable itself?

Either way, I'll google that and read that link


treq5.gif

T R Tipster.png

Share this post


Link to post
Share on other sites

The only thing I don't get is why you would want to use the pointer. LIke what advantage is there to passing a pointer instead of just the variable itself?

Either way, I'll google that and read that link

 

Pointers can be abstracted as references. When you pass a class in Java as a parameter, it passes it by reference; that is, it does not create a copy of the class. Instead, it passes the address of the data to the method. The same goes for storing it. The difference between this C++ code:

 

class A
{
public:
   int foo;
};

void ChangeFoo(A* a)
{
   a->foo = 1;
}

 

and this Java code:

 

class A
{
   public int foo;
}

static void changeFoo(A a)
{
   a.foo = 1;
}

 

is nonexistent. Java internally passes classes as pointers.


ozXHe7P.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.