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

Search:

Type: Posts; User: pdk5

Page 1 of 13 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    2
    Views
    370

    Re: template deduction

    Thanks a lot kaud
  2. Replies
    2
    Views
    370

    template deduction

    Hello,

    I have following piece of template code,


    void PredictionRaster::AutoSetSetIllegalValueIfRequired(PRED_DATA_TYPE pdt, AIBaseRaster *pRaster)
    {
    ASSERT(pRaster);
    if (!pRaster)
    {
  3. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    @kaud: Sorry for not being very clear, when input is exactly 0x0001, the output elements are:
    i.e
    usRank1elt = 1;
    usRank2elt = 1;
    usRank4elt = 1;
    usRank8elt = 1;
    usRank16elt = 1;...
  4. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thanks a lot everybody for your valuable comments and inputs. Very much appreciated.

    @wolle: The switch case (of if else ) is needed, just for efficiency. But otherwise, both values will work for...
  5. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    yes, Thanks a lot kaud. :) .
    I was trying to see if i can use bitset for my function. i.e why i thought, if there was some member function, which can return some bits only , would have been useful...
  6. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thankyou again kaud for the links provided.

    Btw, bitset operator[] just returns one bit. It would have been helpful to specify the number of bits, ( like position and size) . Will look further....
  7. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thanks a lot kaud for all the help. your time and patience. Not sure how i can repay for the all help i received here !!! Very much appreciated.
  8. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Sorry for above post :) . Because of lack of sleep, i am not in good state today :)
  9. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Now we are here discussing about this: I wanted to check if my check for LSB is correct:

    uint16 value = 0x00ff;

    if i consider the layout of value : 1111 1111 0000 0000

    The stored LSB is 0....
  10. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thankyou very much kaud !!! . Very helpful .

    Thanks a lot for your time to make me understand
  11. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Sorry corrected it Victor. thanks
  12. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    As per post #10:

    i.e uint16 num = 0x00ff;

    0x00ff is stored as :
    low address 1111 1111
    high address : 0000 0000

    right shift should have resultedd in : 0111 1111 1000 0000 (0x7f10)
    But...
  13. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thankyou very much kaud. That data is provided by third party. I guess, in that case needs to discuss with them.
  14. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thanks a lot kaud.

    Assuming it is little endian, then my code (the last post, with shift lefts) wont work !!! But when i tested it works !!

    eg
    int main() {

    uint16 x = 0x00ff;

    uint16 y...
  15. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    @kaud: Now i have a doubt, will endianess, affect my shifting as it is 2 bytes .
  16. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Found a bug in my previous code: Modified one is :



    unsigned short usEncodedRank (0x02);
    unsigned short usRank1elt(0), usRank2elt(0), usRank4elt(0), usRank8elt(0), usRank16elt(0),...
  17. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    I wrote a sample program using the bitfields:



    #include "stdafx.h"

    #include <iostream>
    using namespace std;

    struct S {
  18. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thanks a lot kaud comments and suggestion. Very helpful.

    Yes i.e true, my if else will not work !!!

    Was testing now and found that.


    Yes, i need to test all 15 bits are 0 except the last...
  19. Replies
    34
    Views
    3,251

    Re: switch case or if else ?

    Thanks a lot for the comments and reviewing my code :)
  20. Replies
    34
    Views
    3,251

    switch case or if else ?

    Hello,

    I have to extract the info reg rank32 (5bits), rank16(4bits), rank8(3 bits), rank4(2bits), rank2(1bit), rank1(1bit) from the encoded 16 bits

    // Extract the bits from the encoded rank...
  21. Replies
    9
    Views
    1,083

    Re: passing string as default argument (reference)

    Thanks a lot kaud for the info. And also for suggesting the better code . very helpful .
  22. Replies
    9
    Views
    1,083

    Re: passing string as default argument (reference)

    Another minor related question:
    Is it better to do:
    const ActiveAntenna* pActAntenna = activeAntennas.empty() ? nullptr : activeAntennas.front();
    if (!pActAntenna)
    {
    sError = "No active...
  23. Replies
    9
    Views
    1,083

    Re: passing string as default argument (reference)

    Thanks a lot, kaud for the explanation. I was trying to see if i can provide default value as reference yesterday and was not possible. Thankyou very much for making me understand and confirminmg...
  24. Replies
    9
    Views
    1,083

    Re: passing string as default argument (reference)

    I changed the following code works. (without default arguement)
    But then i change all places, the function is currently used

    Will be helpul, if there is better way of doing this ?



    double...
  25. Replies
    9
    Views
    1,083

    Re: passing string as default argument (reference)

    This is some last minute request and i have other things to looks, so sorry for not doing home work.
    Also this is urgent, So kaud, could you kindly help me please ?
Results 1 to 25 of 304
Page 1 of 13 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)