Posts by Thiago Henrique Hupner • 172 points
6 posts
-
5
votes2
answers1246
viewsQ: How to add elements at the "x" position of an Std::vector
How to proceed to add an element at the position I specify in a std::vector? Not to delete what you already have, but to add in the middle. Here’s an example: Let’s assume that inside a std::vector…
-
1
votes0
answers112
viewsQ: Helps port part of the Java code to C++
I am in a project and my 'responsibility' is to port the Java code to C++ that uses Opengl. I’ve done almost everything, but it doesn’t work. I think the problem is in this class that I could not…
-
8
votes1
answer156
viewsQ: To create a function equal to C# Array.Copy in C++
I would like to create a function similar to Array.Copy from C# to C++. This function has the prototype thus: public static void Copy( Array sourceArray, int sourceIndex, Array destinationArray, int…
-
1
votes1
answer87
viewsA: Problem with Allegro 4 and C++
See if that’s not it: void Instance::setTexture(string local){ texture = load_bitmap(local.c_str(), NULL); } So you pass the std::string "translated" to the const char *…
-
0
votes4
answers316
viewsA: "Pure" structs (no pointer) and C error handling
Retouch NULL. Since the return will be of type Struct, return NULL and do a check similar to that: void foo(){ if(retornaStruct() == NULL){ // Com erro, retornado NULL printf("ERRO!!!!\n\n\n"); } }…
-
0
votes1
answer675
viewsQ: How to Collide 2D from C++ Tiles
Hello. I wonder how I can get collision of Tiles in C++. I am using an engine made by my friend, even so, I would like to know how to do. I’m using SDL 2! Grateful from now on Thiago…