Problem with bitset!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sadvipra
    New Member
    • Jan 2007
    • 1

    Problem with bitset!!!

    Hi,
    I am a bioengineer new to C++ (and new to programing in general). I need to create a bit array for an array of integer, where each element of the bit array would be a N-bit representation of each element of the array of integer. My first inclination was to use bitset and utilize the bit manipulation operations it provided, however looks like it is not possible to construct a bitset without explicitly providing the argument, e.g
    int a=4;
    bitset<8> r1(long(a)); would be an error or at best a warning and a wrong result, why would that be please???
    Do any of you have an idea of how I should approach the problem, I mean if bitset is not appropriate what other solution do you propose?
  • sugee
    New Member
    • Jan 2007
    • 35

    #2
    hi,
    I have a COM component which has a method f1() ,f2()and f3(). f1() internally calls f2 and f3. f1 is invoked by c# using reflection. f1 uses global variable and the global varaible value is retained after coming out of f2 and is used in f3. but whereas wen i call f2 directly. it uses a global variable which loses scope if the execution cumes out of this functionf2(). After tat s_ok statement the control goes to disassembly. can anyone explain y this happens. i cudnt understand y tis happens.pls its very urgent and cudnt fix it. pls do reply me and help me to fix it.

    Comment

    Working...