Posts by MrParrot • 106 points
8 posts
-
3
votes2
answers115
viewsA: What is the performance gain when I log into my variable?
The word register suggests to the compiler that this variable should be allocated in a register. This was useful in older compilers, at a time when register allocation algorithms were primitive and…
-
0
votes2
answers237
viewsA: Code conversion is giving error
You will have several problems in the conversion. o char &teste says that the variable teste is being passed by reference, and C does not allow this sort of thing. So you should convert the…
-
0
votes3
answers335
viewsA: Error when De-locating Matrix - double free or corruption C
First, the allocation of matrix lines cop is possibly incorrect. The correct is: for (int k = 0; k < x; k++) { cop[k] = malloc(y * sizeof(long int)); } In your code, you allocated relative to the…
-
1
votes2
answers77
viewsA: How to hide another program window?
I do not think it appropriate to open another program through a call system. In Windows, you can create a new process through system call CreateProcess() after including the header windows.h;…
-
1
votes1
answer870
viewsA: Double chained list - C
You need to install the library libncurses5-dev. In Debian you can install via sudo apt-get install libncurses5-dev. Note that you also need to include the library unistd.h to use the function…
-
0
votes1
answer180
viewsA: How to pass a double pointer as argument and return it from C++ function
The point is that both vector<double> AtmD; and vector<int> XsD; are allocated to the stack when your method decompose is called. Once this method returns, the context of the function is…
-
1
votes2
answers82
viewsA: How to work with binary data
The comment provided by Jefferson Quesado is perhaps more efficient, however I consider: #include <stdint.h> uint16_t binary2decimal(const char buffer[2]) { union { char bytes[2]; uint16_t…
-
0
votes1
answer101
viewsA: What is the point of calling conventions and which one to use?
This serves for the compiler to generate correct code to pass the parameters to a function even though the routine has been compiled by another compiler. You can find more information about this…