Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the float Name#Password
Comment
[*]Italic Text[/*]
[**]Bold Text[/**]
[~]Taimapedia Article[/~]
[%]Spoiler Text[/%]
>Highlight/Quote Text
[pre]Preformatted & Monospace text[/pre]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Kirtaner & Spardot's 420chan Wedding

To all guests, live viewers, and our Internet family, THANK YOU.
VODs will be edited soon, we are all so tired.
Wedding Gifts
C++ from Java by James Badgeham - Mon, 30 Apr 2018 11:44:50 EST ID:uuXCv622 No.37523 Ignore Report Quick Reply
File: 1525103090443.jpg -(131910B / 128.82KB, 900x750) Thumbnail displayed, click image for full size. 131910
Alright boys, I just finished my first year of Applied Computer Science, we were taught Java extensively and had one class on VB in the second semester (god I hope I never have to work with that) Anyways, apparently next year we continue on the programming concepts we learned expanding into things like multi-threading which we haven't learnt yet, except we switch to C++. The thing is, we don't actually get taught C++, we're just taught IN C++. The advice from the second years I got was teach yourself C++ over the summer and that will be the easiest class you take next year, otherwise it will be the hardest. So, what resources could you recommend to make that transition? What are specific Java-to-C++ quirks I might need to know?
>>
Fucking Wublingbanks - Mon, 30 Apr 2018 18:38:08 EST ID:jPnU+Gop No.37524 Ignore Report Quick Reply
Download and spend a weekend on A Tour of C++. Then make a toy project to feel out your compiler and workflow. You'll be way ahead of the curve.
>>
Phyllis Gingerway - Wed, 02 May 2018 02:36:17 EST ID:Xm/W+3lL No.37525 Ignore Report Quick Reply
Learning C++ without learning C might be the largest part of the hurdle for you. Otherwise, many of the object-oriented paradigms of Java carry over into C++. For a very high-level view, read Wikipedia's entry on the differences and similarities between C++ and Java:
https://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B

Also the sooner you download Visual Studio (it's free now, so there's no excuses!) and learn how to use an interactive debugger, the better off your entire life will be.

There are some large differences that you'll have to learn between the languages. Most of them fall under the category of "things Java does for you that C++ makes you do manually". Things like this include:
  • Memory management. Garbage collection is *not* a thing in C or C++, so you have to manage the creation and deletion of your objects manually (using new/delete or malloc/free or placing the objects on the stack as automatic variables).
  • Pointers, references, and by-value passing of variables. This is pretty important in C and C++ (C doesn't support references). Pointers are a new concept of a variable that can "point" to arbitrary locations in memory (or to "null"). References are really just pointers with a nicer syntax that can only point to one thing. So much stuff in C/C++ is pointers and this is a really important language concept, so make sure to try to learn it well!
  • Strings are not really a built-in type. You can use std::string for ease of use, but you really should get comfortable with C-strings (character arrays or char*).
  • Operator overloading is possible in C++. This is not necessarily a required feature, but the ability to redefine operators is useful for various purposes.
  • "const" is a special keyword in C and C++ and it marks a variable as being non-modifiable after the first time it is written. This is a lot like Java's "final" keyword for variables.
  • The built-in types are mostly the same: short, int, float, and double all mean the same things between the two languages. Also both languages have a type for boolean logic ("bool" in C/C++ and "boolean" in Java). C/C++ also support "unsigned" versions of the integer types, namely "unsigned short", "unsigned int" (which is the same thing as just "unsigned"), and "unsigned long". These unsigned variables let you re-use the sign-bit as another data bit, thus doubling the possible range of values (but not allowing you to represent values less than 0).

Helpful tips:
  • Try to compile with the highest warning level your compiler will let you use. This will help you find all of the problem areas in your code before you even run it.
  • Ask people for help early and often if you get stuck. C/C++ is pretty complicated and nuanced and often hearing an alternate explanation will help you get a fresh perspective on why and how things work.


Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.