Posts by André Sanches • 359 points
9 posts
-
0
votes1
answer123
viewsQ: Error in adding foreign key
I am having trouble creating a foreign key. I am doing the project in Mysql Workbench. The generated SQL script is as follows: DROP TABLE IF EXISTS `comercio`.`cliente` ; CREATE TABLE IF NOT EXISTS…
-
3
votes4
answers14598
viewsQ: Print only the column of a matrix
I’m a beginner in python and I’m having doubts about the use of list and tuple and its operators. I’m trying to print only the column of an array but I’m not getting it. I’ve tried the following to…
pythonasked André Sanches 359 -
4
votes2
answers10606
viewsQ: Ways to instantiate an object and declare constructors
In C++ there are several ways to create a constructor and instantiate an object. But there are so many ways I’m confused by the difference of each. Assuming I have the following class: using…
-
0
votes1
answer71
viewsQ: Definition and implementation in different locations
Hello. I am having doubts when implementing a header in folders with different paths. I am placing my header in a folder called "include" and implementations in a folder called "src". To solve this…
-
2
votes2
answers704
viewsQ: Pointer operators passing by reference
I’ve been studying some codes I found on the Internet, and one of them used a prototype implementation as follows: void changeMode(Mode &m){ m.loop = true; m.quit = false; } See that function…
-
1
votes1
answer199
viewsQ: Pointer to method
I started studying object orientation and I’m trying to call pointer to method, but I’m having difficulties. The implementation of the method startAllegro class Application is as follows: void…
-
6
votes2
answers475
viewsQ: Malloc improperly reserving memory?
I am studying dynamic memory allocation and came across an error that apparently the compiler is not warning about. The code is very simple: int *ptr = (int *) malloc(sizeof(int)); ptr[0] = 5;…
-
7
votes1
answer2796
viewsQ: What are Macros and how to use them?
So far during my C programming course, the only contact I had with macros came from standard libraries and not really knowing what was going on when calling these macros. I would like to know…
-
1
votes1
answer87
viewsQ: Problem with Allegro 4 and C++
I’m trying to create a game in Allegro 4, but I am having problems with a method, more specifically with an attribute BITMAP. The program compiles but stops working right away. Follow the code:…