I think a proper garbage collector would be considered spoiled! We still have to make sure to free/delete our dynamically allocated memory. I think it's Java that you don't have to worry about this?
Smart pointers can make this much easier to deal with.
Search found 115 matches
- March 19th, 2018, 2:40 pm
- Forum: Everything
- Topic: The C language is dangerous
- Replies: 8
- Views: 2670
- March 19th, 2018, 4:00 am
- Forum: Everything
- Topic: The C language is dangerous
- Replies: 8
- Views: 2670
Re: The C language is dangerous
Ahh, okay. This makes sense now. This could all be fixed if you could have a custom assignment operator for structs like you said.
So to wrap up, stick to C++.
So to wrap up, stick to C++.
- March 18th, 2018, 11:15 pm
- Forum: Everything
- Topic: The C language is dangerous
- Replies: 8
- Views: 2670
Re: The C language is dangerous
I'm not sure I follow. I tried your code using "C-strings" (char*) and got the correct results, as well with using the standard library strings. I guess "std::string" is a syntax macro you created in C to represent C++? I don't see how B is overwriting C in your example.
- March 15th, 2018, 5:53 am
- Forum: Everything
- Topic: Noob learns to code in 3 months
- Replies: 670
- Views: 198463
Re: Noob learns to code in 3 months
Nice benchmarking class. I'll be using this myself. Thanks!
- March 15th, 2018, 5:52 am
- Forum: Everything
- Topic: Macros
- Replies: 4
- Views: 1761
Re: Macros
@albinopapa: I like your example! It seems simple enough. Unfortunately the API's I've explore seemed to be much more complex in their nature, and are much harder to trace the actual code the macros generate. @chili: That's what frustrates me the most. And also, like you found on your exploration of...
- March 15th, 2018, 3:28 am
- Forum: Everything
- Topic: Macros
- Replies: 4
- Views: 1761
Re: Macros
Here are two examples of the macros being "expanded out" (recommend you paste these in visual studio or sublime text for legibility) // Supplied function OF::GiveAchievement(player, const name[]){} // Initial replacement from "OF::" macro static stock __GiveAchievement__(){return _:SPF0:SPF1:0;}of_G...
- March 15th, 2018, 3:00 am
- Forum: Everything
- Topic: Macros
- Replies: 4
- Views: 1761
Macros
I recently finished Chili's UE4 tutorials and caught wind of his frustration with macros. I believe it was mentioned in prior videos of his as well. I too understand the headaches that come with trying to read atrocious macros. The below example was made for the Pawn scripting language. It has extre...
- March 14th, 2018, 5:00 pm
- Forum: Everything
- Topic: Constructor Qustion.
- Replies: 3
- Views: 1652
Re: Constructor Qustion.
Nice explanation. You should add this to the sticky regarding constructors.
- March 5th, 2018, 7:16 pm
- Forum: Everything
- Topic: Simple Coding Challenge
- Replies: 14
- Views: 4662
Re: Simple Coding Challenge
Attempt taking albinopapa's approach #include <stdio.h> int main() { constexpr int size = 100; char input[size]; char tmp[size]; int index = 0; gets_s(input, sizeof(input)); for (int i = 0; i < sizeof(input); i++) { if (input[i] == ' ') { if (i != 0 && input[i - 1] != ' ') tmp[index++] = input[i]; }...
- March 3rd, 2018, 6:50 pm
- Forum: Everything
- Topic: i don't have engine.exe
- Replies: 7
- Views: 3160
Re: i don't have engine.exe
Check out this page - http://wiki.planetchili.net/index.php?t ... ili_Forums
To actually zip the solution once you have followed the steps on this page, right-click the folder and select Add To Archive or Create ZIP
To actually zip the solution once you have followed the steps on this page, right-click the folder and select Add To Archive or Create ZIP