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

Search:

Type: Posts; User: versacestl

Page 1 of 6 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    Sounds good.. Already did this part..

    I am not seeing a bitwise conversion back to a uint or int though.. Guess i can just convert it to u_long and cast it to a uint.

    Also to convert the bitset...
  2. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    std::bitset<8> my_bitset(value);

    This seems to work just find, giving me the 8 bit representation..

    And i will need it in a string now i guess since i need to flip a random bit in this bitwise...
  3. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    Ok well i got it working but its giving me the 32 bit representation.

    How can i take

    bitset<sizeof(value) * CHAR_BIT> my_bitset(value);

    and make it fixed to 8 since i know the byte value...
  4. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    The reason why.. is because i have no idea what the following is doing



    bitset<sizeof(value) * CHAR_BIT> my_bitset(value);



    Mostly '<sizeof(value) * CHAR_BIT> ' -->> setting the size...
  5. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    Could you show an example of how to use the bitwise() conversion..

    I can use ints, but would rather use unsigned int,

    I am not seeing a type in which i can do so for ints or uints..

    And i...
  6. Replies
    20
    Views
    2,216

    Re: Converting Integer to bytes

    Ok, let me rephrase, i need to get the 8 bit representation of that byte..
  7. Replies
    20
    Views
    2,216

    Converting Integer to bytes

    How can i get the byte value of an integer..

    Let's say I need it for number '204'
    The byte representation would be --> 11001100
    Another example would be number '122' -- > 01111010

    The minimum...
  8. Re: Two Dimentional Array (int) copying/returning

    It almost seems that way, but the function actually has one more parameter am passing in that i didn't include, which determines the choice of vector to return, 4 different algorithms performed on 4...
  9. Re: Two Dimentional Array (int) copying/returning

    Apparently This works:




    vector< vector<int> > twoD (int columns, int rows);

    int main (int argc, char ** argv)
    {
  10. Re: Two Dimentional Array (int) copying/returning

    No it cannot be determined at compile time..

    So i guess i am doing vectors..

    I will have to look up how to return a vector from a function and how to declare the function type.

    I'm assuming...
  11. Re: Two Dimentional Array (int) copying/returning

    I would rather not restructure the code as a whole.

    IF i create global 2D arrays and just copy to them rather then passing back, would that be easier?
  12. Two Dimentional Array (int) copying/returning

    I have a function that has a two dimensional array i need to return:
    how can i get the 2D array into another array without reading it by row and column in a loop
    i.e --> the idea





    int...
  13. Replies
    7
    Views
    830

    Re: c++ Chars and strings help

    Thanks again everyone.. I hate getting introduced into languages where the syntax is a bit different. I am used to doing java and c#..

    Also i had to change the += to just a + to append the...
  14. Replies
    7
    Views
    830

    Re: c++ Chars and strings help

    Yes some of the functions below this do have the potential to throw errors..

    Thanks for the intuition guys.. I am going to give it a shot right now..
  15. Replies
    7
    Views
    830

    c++ Chars and strings help

    I am trying to figure out how to cast the filename into a string and use the substring to remove the '.png' or whatever declaration at the end given the input to the program..

    How can i cast the...
  16. Replies
    1
    Views
    898

    XML Insert within XML

    I am trying to insert a snippet of XML from a XML file, into the original file that I load.

    Example:
    I load XML file xmlFile1
    Then load another xml file which is basically a snippet of XML that...
  17. Replies
    8
    Views
    2,751

    Re: VBA Restricting column length in excel

    I thought about this also.. But unfortunately there is no such function to implement while the cell is active.
  18. Replies
    8
    Views
    2,751

    Re: VBA Restricting column length in excel

    I realize now that it may not be possible to validate a cell while the user is typing in it, i.e. it's impossible to prevent the user typing more than x characters. Since, the validation only kicks...
  19. Replies
    8
    Views
    2,751

    Re: VBA Restricting column length in excel

    I don't really have any code for this as it is just a simple script.. I don't use VBA often so am not too sure of the syntax. I believe there may be something to set the attributes of the entire...
  20. Replies
    8
    Views
    2,751

    Re: VBA Restricting column length in excel

    Number of characters... Where



    LEN(Column) ! > 20
  21. Replies
    8
    Views
    2,751

    VBA Restricting column length in excel

    I am trying to restrict column length for an entire column in excel.. which uses VBA..

    I am not talking about the width, but the actual characters allowed in this cell..

    Any help would be...
  22. Replies
    16
    Views
    4,529

    Re: VB Regular Expression Help

    Like is being used on rows.column coming back from a table. Hence

    Boolean = Row.Column Like ("RegEx")

    This is working fine for all the other expressions i am using.
  23. Replies
    16
    Views
    4,529

    Re: VB Regular Expression Help

    I just tried



    Dim WeightFactor As New Regex("^([0-9]|[1-9][0-9]|100)\.[\d][\d][\d][\d][\d][\d]")
    validWeightFactor = WeightFactor.IsMatch(Row.WEIGHTFACTOR)


    and it seems to...
  24. Replies
    0
    Views
    509

    VB Regular Expression Help

    I put this in the 6.0 vb section by accident, but here is my issue:

    http://www.codeguru.com/forum/showthread.php?p=1962680#post1962680
  25. Replies
    16
    Views
    4,529

    Re: VB Regular Expression Help

    I just realized this is Microsoft Visual Basic .NET not 6.0..
    I will post a link to this in that section.
Results 1 to 25 of 144
Page 1 of 6 1 2 3 4





Click Here to Expand Forum to Full Width

Featured