Dialecticus

Belgrade, Serbia

Age: 41

Mihajlo Cvetanović, Belgrade, Serbia

14h
revised Visual Studio 2012 and Program Compatibility Assistant
added 17 characters in body
17h
awarded Nice Answer
1d
answered Offset of symbol 'Symbol' inconsistent
1d
comment How can I write these loops in C instead of using #define?
Function rand() returns a value between 0 and RAND_MAX, so the expression rand() < RAND_MAX will be 1 most of the time, and 0 in one in RAND_MAX cases (very rare). Is this what you want?
1d
comment How can I write these loops in C instead of using #define?
loop_xy univ[y][x] = rand() < RAND_MAX; --> loop_x loop_y univ[y][x] = rand() < RAND_MAX; --> for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) univ[y][x] = rand() < RAND_MAX;
2d
comment How to create an array of templated class objects for different data types?
Pila should not be a class template, but an ordinary class, and data should be of some new type ItemBase, and a new class template should derive from it, template<class T> class Item : ItemBase { T* item; }
2d
comment Why does my program run fine on Windows but not linux?
Need to see the errors...
2d
comment C++ Linker Trouble, Unresolved External Symbol with my own code
It could be some rogue extern "C" that changes the function signature between declaration and definition. extern "C" functions are, like, totally different than those that are not extern "C".
2d
revised excessive memory usage when using pointers?
added 213 characters in body
Apr
26
comment Tetris Rotation without arrays
Also, different coordinates should not exist in the same expression. Since you are rotating a piece then all values that affect x coord must be of y kind, and all that affect y must be x in nature.
Apr
26
comment Tetris Rotation without arrays
To verify that transformation is correct rotate the origin block itself. The result should be that the block does not move. In your case newX remains x2, but newY becomes y2 + 1, instead of remaining y2.
Apr
25
comment Random Number Generation : same C++ code, two different behaviors
Wait a minute! You seeded the Mersenne twister each time you call the function? How about using the same object and seeding it only once?
Apr
25
comment Random Number Generation : same C++ code, two different behaviors
Compare your random generators and report to us. Are the numbers given by rand() the same in both places?
Apr
25
revised Wrong output when searching for prime numbers in given interval
added 8 characters in body; edited title
Apr
25
comment Poor performance of COM-component
How do you measure performance difference? Maybe it's some issue with marshaling. Does your actual run() function lack any function parameter? If not try a test where the function actually does not have any parameters.
Apr
24
comment Parse number until comma
line is your input, but what is actually your output? You talk both about a comma and a point. It's a bit confusing. Please provide a relevant input example and a desired output.
Apr
22
comment Trying to create a templated linked list that contains different types of data
Maybe ditch the templating and use inheritance. Or, if inheritance is impossible, use your own VARIANT that can hold all the types you care about.
Apr
18
comment multi dimensional array allocation in chunks
This question may be closed because it might not be a good fit for Stackoverflow. That being said, it probably does not matter what you use at this point. If you are making a performance heavy app (like a commercial game, or some scientific algorithm that takes days to finish) then a performance question like this is relevant. Actually, you should see the performance difference for yourself. Make two test cases that are relevant to you, and compare their results.
Apr
13
comment Sliding window with roi c++
@Hertzial_97 use step bigger than one pixel?
Apr
13
comment Sliding window with roi c++
@Hertzial_97 sorry, to be able to help you I need more detailed info about the problem that you now have.
1 2 3 4 5