Click here to Skip to main content
15,885,895 members

Comments by Bruno van Dooren (Top 9 by date)

Bruno van Dooren 3-Jan-24 8:38am View    
Ok, but the pragma directives you mentioned only change where exactly in the binary pe image, certain pieces of compiled code are stored. What I do not yet understand is how the exact layout of the compiled code in the executable changes the coding job.
Bruno van Dooren 19-Dec-23 4:38am View    
I got downvoted for saying this :)
Bruno van Dooren 18-Dec-23 12:15pm View    
YOU say: if it's x = (char*) y it will still shift by 4 bytes when x + 1, etc

x is a char*.
If you declare x as int* you are ignoring compiler warnings.

Bruno van Dooren 18-Dec-23 10:55am View    
>> if I write *((char*)ptr + 2) then the arithmetics changes and instead of 2*sizeof(int) changes into 2*sizeof(char) ??

that is correct.

>> if it's x = (char*) y it will still shift by 4 bytes when x + 1, etc

No, it won't. if X is of type char* and you do +1 it will shift by 1 byte.
Bruno van Dooren 25-Jun-23 7:07am View    
I agree with most of your comments, except the one about memory.
This is an assignment for a HFT firm. Algorithm speed is everything to those people. Anything else is a secondary concern if at all. Int64 is the native integer length and can be done in a single instruction. It could be that Int32 is equally fast but I would benchmark them both and go with the fastest one because that's what they are after.