• Looking for C++ tutorials. Already know C#.
    17 replies, posted
I'm currently developing a game in Unity, but as some of you may know, C++ is very important to know if you want to be a game developer. I already know C# quite well, and I want to start learning C++ now. My issue is that all of the tutorials I've found, are for people who have never programmed before. I mean, they spend several pages explaining what a variable is, and I obviously don't need to know that. All I want to know is how to set up one in C++. Do you know any websites or books that are good for learning C++? Thanks in advance. :)
I can't really tell what your situation is. Are you trying to write a Unity game in C++? If so, it won't work. Are you learning C++ only because you think it's the only way to make a game? If so, that's very correct. Are you skipping over parts of a tutorial just because you think it's not important? If so, don't do that. but here, have a book: [url]http://www.acceleratedcpp.com/[/url]
If you are not a genius you can't learn C++. Even Einstein said "I want to know C++ the rest are details." but he never attempted to learn.
[QUOTE=terike;39134547]If you are not a genius you can't learn C++. Even Einstein said "I want to know C++ the rest are details." but he never attempted to learn.[/QUOTE] If you're going to shitpost, atleast write something funny.
[QUOTE=supersnail11;39124386]I can't really tell what your situation is. Are you trying to write a Unity game in C++? If so, it won't work. Are you learning C++ only because you think it's the only way to make a game? If so, that's very correct. Are you skipping over parts of a tutorial just because you think it's not important? If so, don't do that. but here, have a book: [url]http://www.acceleratedcpp.com/[/url][/QUOTE] Wow... Just wow. So here's the deal. "Are you trying to write a Unity game in C++? If so, it won't work." No, I am currently writing a Unity game in C#. I don't need help with that. "Are you learning C++ only because you think it's the only way to make a game? If so, that's very correct." I am learning C++ because that is a "primary" language so to speak. Most game engines support C++, some even only support C++. If you're wondering what I need it for specifically, right now, it's for Steamworks. They only support C++ so I'm going to have to learn it to use Steamworks, but it's generally smart to know C++ if you want to program games. "Are you skipping over parts of a tutorial just because you think it's not important? If so, don't do that." No, of course not. The tutorials I've found are for people who haven't programmed before, who don't know any language. People who don't know what variable is, and can't tell the difference between a statement and a method. Tutorials spend a lot of time explaining this, and as I already know it, I need one that just get's straight to the point. I hope this clarified it for you.
There is really not that much difference between C++ and C# besides the syntax, things you do need to pay particular attention to are the use of pointers, references, templates and memory management in general. Variable: type name; Define and initialize variable: type name = assignment; Pointer: type* name; Define and assign pointer to variable: type* name = &variable; Dereference pointer (access pointed to variable): *pointer = 4; Assign pointer to pointer type* pointer1 = pointer2; Make pointer safe: pointer = NULL; Reference: type &reference; Define and assign reference: type &reference = variable Modify assigned variable: reference = 4; Function implementation returntype name(type arg1, type arg2) { } Function definition: returntype name(type arg1, type arg2); Array definition: type name[size]; Array definition and implementation: type name[] = { val1, val2, val3 }; Array access: name[index] = 4; Multidimensional array: type name[size] [size]; Array of pointers: type* name [] = { &var1, &var2 }; Pointer to an array of pointers: type** name = new type*[size]; Class: class name { }; Class inheritance: class name : access base_class { }; Object instantiation: class name; Object member access: object.member = 4; Object pointer with memory allocation: class* name = new class(); Deleting allocated object: delete object; Access to object pointer members: object->member = 4;
[QUOTE=Doom;39135621]If you're wondering what I need it for specifically, right now, it's for Steamworks. They only support C++ so I'm going to have to learn it to use Steamworks.[/QUOTE] Just write a wrapper?
[QUOTE=Chryseus;39135929]There is really not that much difference between C++ and C# besides the syntax[/QUOTE] no
[url=http://www.cplusplus.com/doc/tutorial/]Here anyone?[/url]
[QUOTE=Doom;39123664]Do you know any websites or books that are good for learning C++?[/QUOTE] I think the book you are looking for is Accelerated C++, which only concentrates on the things specific to C++ and is designed for programmers of other languages. It is very short and you will know the ins and outs of the language by the end of it. I'd avoid on-line tutorials because they tend to teach an outdated style of coding C++.
[QUOTE=Chryseus;39135929]There is really not that much difference between C++ and C# besides the syntax,[/QUOTE] You've got to be fucking kidding me. If -anything- is similar between C++ and C# it IS the syntax, the rest is entirely different. [quote]It is very short and you will know the ins and outs of the language by the end of it[/quote] No you don't, you'll know the very basics at most. ... Still, the suggestion of Accelerated C++ is pretty good. Sure it's a beginner book, but it doesn't take you for an idiot and there's a lot of learning to be done even in the first few chapters. It will also teach you some important concepts of C++ like using the standard library, pointers and such.
[QUOTE=supersnail11;39124386]Are you trying to write a Unity game in C++? If so, it won't work.[/QUOTE] Why does he have to write a game in Unity? Source and UDK use C++.
[QUOTE=gparent;39143261]You've got to be fucking kidding me. If -anything- is similar between C++ and C# it IS the syntax, the rest is entirely different.[/QUOTE] I wouldn't really go as far as to say entirely different.
[QUOTE=fgsfds;39142434]I think the book you are looking for is Accelerated C++, which only concentrates on the things specific to C++ and is designed for programmers of other languages. It is very short and you will know the ins and outs of the language by the end of it. I'd avoid on-line tutorials because they tend to teach an outdated style of coding C++.[/QUOTE] Thank you very much, i'll take a look at it. If anything, it'll be a start :) [QUOTE=SiPlus;39143488]Why does he have to write a game in Unity? Source and UDK use C++.[/QUOTE] I think it's because in the OP I mention that I'm using Unity. I guess he thought I was trying to code C++ in Unity. Your point is exactly why I find it a good idea to learn C++, as many engines support it.
[QUOTE=Doom;39135621]Wow... Just wow. So here's the deal. "Are you trying to write a Unity game in C++? If so, it won't work." No, I am currently writing a Unity game in C#. I don't need help with that. "Are you learning C++ only because you think it's the only way to make a game? If so, that's very correct." I am learning C++ because that is a "primary" language so to speak. Most game engines support C++, some even only support C++. If you're wondering what I need it for specifically, right now, it's for Steamworks. They only support C++ so I'm going to have to learn it to use Steamworks, but it's generally smart to know C++ if you want to program games. [/QUOTE] I meant to say "it's not very correct" but somehow I missed the "not". But yeah, that makes sense. And the reason I was confused for the first one is because you mentioned you were making a unity game in the beginning of your post and I assumed that was related to you learning C++.
Oh, that makes a lot more sense, I see your confusion. Sorry if I was a bit rough, I didn't mean anything with it :)
Quote from another thread: [QUOTE=Mozartkugeln;39039538]Regarding literature: If you decide to take up C++, [URL=http://amzn.com/0321714113]C++ Primer[/URL] will be invaluable to you. It is by far the best book that I've come across, not to mention that it's been updated for the latest version of the language. It might, however, become overwhelming if you're an absolute novice (which I assume you are), so you may want to start with [URL=http://amzn.com/020170353X]Accelerated C++[/URL] instead and then move on to C++ Primer or similar books. Finally, I'd like to point out that Accelerated C++ is outdated, but that shouldn't be a problem for you.[/QUOTE]
[QUOTE=terike;39134547]If you are not a genius you can't learn C++. Even Einstein said "I want to know C++ the rest are details." but he never attempted to learn.[/QUOTE] i guess me and half of this subforum are geniuses then, thank you kind sir
Sorry, you need to Log In to post a reply to this thread.