Search:

Type: Posts; User: Mezzano

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    22
    Views
    8,656

    Either you can't read or you think arbitrarily...

    Either you can't read or you think arbitrarily large integer == unsigned long long. Sorry if I find your solution lacking, just stating my opinion, obviously you aren't very open to any ideas that...
  2. Replies
    22
    Views
    8,656

    No I showed you how to do it above, log10. As...

    No I showed you how to do it above, log10. As for the suggestion with sprintf into buf, that is great but you need to have buf be the right size. You could just have it be as many digits as the...
  3. Replies
    22
    Views
    8,656

    Yes but with the other ways suggested he must do...

    Yes but with the other ways suggested he must do it twice, he must loop once through the number just to calculate how large the array needs to hold the string representation of it. Then he needs to...
  4. Replies
    14
    Views
    5,203

    Why even have the ability to cast at all then,...

    Why even have the ability to cast at all then, lets just take it out it is obviously useless.




    No it was more, it works on every compiler I have ever used. Of course if you want to assume...
  5. Replies
    22
    Views
    8,656

    Better still do this int res = (int)...

    Better still do this




    int res = (int) log10(number) + 1;
  6. Replies
    8
    Views
    1,979

    Yeah you get a lot of that in public discussion...

    Yeah you get a lot of that in public discussion board about programming ;) I was in the same boat, I slept through most of HS and didn't really give a ......... One day I woke up, pulled my head...
  7. Yes, but as I mentioned (I think I did) it is a...

    Yes, but as I mentioned (I think I did) it is a style decision. I personally prefer not to make an extraneous variable just to hold the return value so I can see whether to do the assignment or not,...
  8. Replies
    14
    Views
    5,203

    The second one is lacking a cast but it is...

    The second one is lacking a cast but it is certainly not incorrect. What is incorrect about setting a variable to hold its own address? I mean, is it useful? Who knows ;) But it is not "wrong". ...
  9. Replies
    5
    Views
    4,902

    Hashing on a fixed size table without chaining...

    Hashing on a fixed size table without chaining seems a bit impossible. If you ever get up to entering 8 elements you are done, if you don't chain or rehash your table is full, game over. I realize...
  10. Replies
    15
    Views
    2,659

    I guess we can't really continue the discussion...

    I guess we can't really continue the discussion because I don't know the dirty details of the JIT'ing process. However, I do know that is has been publically stated that the JIT compiler DOES do...
  11. Replies
    5
    Views
    4,902

    To be technical that is the structure of an...

    To be technical that is the structure of an element in your hash table, the hash table itself is likely just an array of these things, this is what gives it O(1) lookup, on average.




    No...
  12. Thread: I Know C++

    by Mezzano
    Replies
    7
    Views
    1,556

    True but it was mentioned by the first poster so...

    True but it was mentioned by the first poster so I didn't touch on that :)


    Mezzano
  13. Replies
    15
    Views
    2,659

    Hmmm.... I would argue that. By that logic then...

    Hmmm.... I would argue that. By that logic then a compiler could not optimize anything, because it would be unable to determine if the optimization caused a relied upon side effect not to happen. ...
  14. Thread: I Know C++

    by Mezzano
    Replies
    7
    Views
    1,556

    I know C/C++ and C# (among other languages that...

    I know C/C++ and C# (among other languages that don't have C's in their names), so here is my view on it.

    Ease of GUI design: if you have coded GUI's in C++ you probably know you spend a LOT of...
  15. Replies
    15
    Views
    2,659

    In the original post I said "this assumes the...

    In the original post I said "this assumes the getter is trivial", which would not be the case if it "did things other than just returning the value". I said if that was the case the compiler would...
  16. This opens up the ugly decision about who is...

    This opens up the ugly decision about who is responsible for freeing the memory, assuming the memory for the original array was alloced. If you have them pass in a pointer to the array as it is and...
  17. Replies
    15
    Views
    2,659

    But it's not. We are talking about two calls to...

    But it's not. We are talking about two calls to the same getter interspaced by no other code. Polymorphism doesn't come in to play since after the first call the result of the getter is already in...
  18. Replies
    7
    Views
    2,034

    First off you are mistaken, by definition an...

    First off you are mistaken, by definition an array is contiguous. If you don't believe me feel free to check out this nice article on MSDN concerning data structures in .NET which gives a thorough...
  19. Replies
    7
    Views
    2,034

    This is an "old" post so not sure if you are...

    This is an "old" post so not sure if you are interested anymore or not..but here goes

    The first line will allocate an array big enough to hold a thousand pointers (since your object is a ref...
  20. Whats that old saying "All software engineering...

    Whats that old saying "All software engineering problems can be solved by adding another layer of abstraction, all performance problems can be solved by removing a layer of abstraction" :) Anyways,...
  21. The problem can be solved as another user posted,...

    The problem can be solved as another user posted, just return the array. The reason it doesn't work as is is that you are passing a in by value, and then binding the local (to the init function)...
  22. Replies
    6
    Views
    1,211

    It is more C'ish but you can use memcpy or...

    It is more C'ish but you can use memcpy or memset.


    Mezzano
  23. Replies
    5
    Views
    1,798

    I was referring to the windows version as that is...

    I was referring to the windows version as that is the only system I know that currently has a robust version of C#. Last I heard Mono, as well as another project implementing C# on linux, were still...
  24. Replies
    15
    Views
    2,659

    I would assume the compiler isn't completely...

    I would assume the compiler isn't completely braindead and will NOT call the getter twice. After the first call the pointer to the SomeDumbPropertyValue already resides in a register, thus it can be...
  25. Replies
    15
    Views
    2,659

    Cleaner is a stylistic decision, and no there...

    Cleaner is a stylistic decision, and no there would be no performance improvement it is just syntactic sugar. As for the other poster that suggested we could just go back to "gotos and functional...
Results 1 to 25 of 28
Page 1 of 2 1 2