CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: vincegata

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Re: [RESOLVED] unsigned char c = -1; // c has value 255, why is that?

    I do use -Wall but for release code only, thank you for a tip.
  2. Re: Implicit default ctor - what is it for?

    I see, thank you.
  3. [RESOLVED] Implicit default ctor - what is it for?

    Hello,

    Implicit default ctor does not initialize the built-in data members, so what is it needed for?

    Thanks.
  4. Re: [RESOLVED] unsigned char c = -1; // c has value 255, why is that?

    Ok, I see, thank you.
  5. Re: [RESOLVED] unsigned char c = -1; // c has value 255, why is that?

    I know how it's calculated: e.g. (-1 modulo 256) + 256 = 255, I am wondering about the internals.

    Btw, "C++11 Clause 4.7 - Integral conversions" is it from the C++ standard? Where can I get?
  6. Re: unsigned char c = -1; // c has value 255, why is that?

    Thanks.
  7. [RESOLVED] unsigned char c = -1; // c has value 255, why is that?

    Hello,

    So, the

    unsigned char c = -1; // c has value 255

    Why is that, on a bit level? Negative sign would set the highest bit to 1, and 1 would set the lowest bit to 1: 10000001 which is...
  8. Replies
    5
    Views
    310

    Re: How does const_cast work?

    Thanks for replies.
  9. Replies
    5
    Views
    310

    [RESOLVED] How does const_cast work?

    Hello,

    const_cast<> supposed to "cast away const" but it does not. The output is: 1002 1001, I expect it to be 1002 1002. Could someone explain what's going on? Thx.



    #include<iostream>...
  10. Re: A pointer to an array: int* p = arr; vs. int (*p2)[10] = &arr ?

    I see, thanks guys for all responses.
  11. [RESOLVED] A pointer to an array: int* p = arr; vs. int (*p2)[10] = &arr ?

    Hello,



    int arr[10];
    int* p = arr;
    int (*p2)[10] = &arr;


    So, pointer p is a pointer to an array, I can use it to access elements of arr as in *(p+5).
  12. Re: [RESOLVED] Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    Thanks for your help.
  13. Re: Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    > What does the pointer value have to do with the amount of RAM you have?
    > Regards,
    > Paul McKenzie

    Because it looks like my object is located beyond the memory that I actually have.
  14. Re: Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    I think it's just not showing two leading zeros in 0x7fff0d065098.
  15. Re: Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    Also, 0x7fff0d065098 is 140,733,411,905,688 decimal, which is 140 Terabyte, 733 MB, and so on. I have only 8GB of RAM on my laptop, how is that possible?
  16. Re: Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    Right, it shows 8.

    I am not looking for the size of the pointer or reference, but, let's say, I want to know the address where my object is stored.
  17. [RESOLVED] Why address of an object is 6 bytes and not 8 bytes on 64 bit Linux?

    Hello,

    My code:



    int i12 = 1001;
    cout << i12 << " " << &i12 << endl;
  18. Re: select() returns "ready" even after producer is done (FIFO)

    My FIFO is a class, it is the producer and consumer applications use select() to monitor sockets and stdin besides the FIFO so the loop is quite involved.

    Anyways, select() is not supposed to...
  19. [RESOLVED] select() returns "ready" even after producer is done (FIFO)

    Hello,

    I have a producer application that writes data into a FIFO, and I have a consumer application that reads data from FIFO utilizing select() and read() functions inside of a while(true) loop....
  20. Re: [RESOLVED] STL string concatenation does not work.

    > If you know in advance that the string will become very long, it could make sense to call "reserve" upfront. This way there will be less memory reallocations during the string building process. But...
  21. Re: STL string concatenation does not work.

    That's the way I did it but I need to build long strings from pieces so I had to declare several variables.
  22. Re: STL string concatenation does not work.

    -- thank you.
  23. [RESOLVED] STL string concatenation does not work.

    Hello,

    Why it's not working and how to make it work?



    string str = "hello" + " *** ";


    Thank you.
  24. Replies
    11
    Views
    1,115

    Re: Running on 8 Cores?

    Creating threads is not difficult at all, it takes only a few lines of code - find some samples. Parallelizing your code to run on those threads would be challenging - google for it, I bet you'll...
  25. Re: FIFO reads endlessly after I close it on the producer side.

    Right, there was an error EEXIST when I was creating FIFO b/c that FIFO already existed.

    Thanks again for your help.
Results 1 to 25 of 60
Page 1 of 3 1 2 3



HTML5 Development Center

Click Here to Expand Forum to Full Width