Click here to Skip to main content
15,867,762 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: I have spy ware on this computer I tracked it...... Pin
Richard MacCutchan23-Sep-15 21:42
mveRichard MacCutchan23-Sep-15 21:42 
AnswerRe: I have spy ware on this computer I tracked it...... Pin
Richard MacCutchan22-Sep-15 21:13
mveRichard MacCutchan22-Sep-15 21:13 
QuestionRe: I have spy ware on this computer I tracked it...... Pin
Paul Conrad13-Oct-15 7:17
professionalPaul Conrad13-Oct-15 7:17 
AnswerRe: I have spy ware on this computer I tracked it...... Pin
Richard MacCutchan13-Oct-15 8:03
mveRichard MacCutchan13-Oct-15 8:03 
GeneralRe: I have spy ware on this computer I tracked it...... Pin
Paul Conrad13-Oct-15 8:13
professionalPaul Conrad13-Oct-15 8:13 
QuestionSet a Byte Array to a SqlServer database on C++\Cli Pin
betedesvosges24-Aug-15 3:40
betedesvosges24-Aug-15 3:40 
SuggestionRe: Set a Byte Array to a SqlServer database on C++\Cli Pin
Richard Deeming24-Aug-15 5:08
mveRichard Deeming24-Aug-15 5:08 
Questionsending a opencv Mat to a shared library generated by matlab Pin
Member 1156211423-Aug-15 9:35
Member 1156211423-Aug-15 9:35 
Questioncan anyone help me it this Pin
Alaa Radwan21-Aug-15 18:18
Alaa Radwan21-Aug-15 18:18 
GeneralRe: can anyone help me it this Pin
Richard MacCutchan21-Aug-15 22:05
mveRichard MacCutchan21-Aug-15 22:05 
QuestionUpdating my projects to retarget to .NET 4.6 Pin
John Schroedl18-Aug-15 2:24
professionalJohn Schroedl18-Aug-15 2:24 
AnswerRe: Updating my projects to retarget to .NET 4.6 Pin
John Schroedl20-Aug-15 7:29
professionalJohn Schroedl20-Aug-15 7:29 
Questionusing 'mkdir' for creating new directory Pin
Member 93502373-Aug-15 5:24
Member 93502373-Aug-15 5:24 
AnswerRe: using 'mkdir' for creating new directory Pin
Richard MacCutchan3-Aug-15 5:50
mveRichard MacCutchan3-Aug-15 5:50 
GeneralRe: using 'mkdir' for creating new directory Pin
Member 93502374-Aug-15 4:26
Member 93502374-Aug-15 4:26 
GeneralRe: using 'mkdir' for creating new directory Pin
Richard MacCutchan4-Aug-15 5:51
mveRichard MacCutchan4-Aug-15 5:51 
GeneralRe: using 'mkdir' for creating new directory Pin
PIEBALDconsult3-Aug-15 6:16
mvePIEBALDconsult3-Aug-15 6:16 
AnswerRe: using 'mkdir' for creating new directory Pin
Wes Aday3-Aug-15 9:26
professionalWes Aday3-Aug-15 9:26 
Questionadding pointer arrays Pin
Member 935023729-Jul-15 22:09
Member 935023729-Jul-15 22:09 
AnswerRe: adding pointer arrays Pin
Richard Andrew x6430-Jul-15 9:29
professionalRichard Andrew x6430-Jul-15 9:29 
AnswerRe: adding pointer arrays Pin
Richard MacCutchan30-Jul-15 21:26
mveRichard MacCutchan30-Jul-15 21:26 
GeneralRe: adding pointer arrays Pin
Member 935023730-Jul-15 21:51
Member 935023730-Jul-15 21:51 
GeneralRe: adding pointer arrays Pin
Richard MacCutchan30-Jul-15 22:16
mveRichard MacCutchan30-Jul-15 22:16 
GeneralRe: adding pointer arrays Pin
Member 935023730-Jul-15 23:16
Member 935023730-Jul-15 23:16 
GeneralRe: adding pointer arrays Pin
Richard MacCutchan30-Jul-15 23:42
mveRichard MacCutchan30-Jul-15 23:42 
I would do something like:
C++
bool* pBool = boolArray + 10;     // skip first 10 elements
srand( (unsigned)time( NULL ) );  // set a random seed for the generator
for (int i = 0; i < 10; ++i)      // loop round each set of 12 elements, i.e. 10 times
{
    memset(pBool, 1, sizeof(bool) * 12); // set all 12 elements to 1s
    int rIndex = rand() % 12;            // get index in range [0 .. 11]
    pBool[rIndex] = 0;                   // set this one to zero
    do
    {
        int rIndex2 = rand() % 12; // get index in range [0 .. 11]
        pBool[rIndex2] = 0;        // set this one to zero
    } while (rIndex2 == rIndex);   // make sure they are different elements

    pBool += 12;                   // point to the next set, and repeat
}

I have not tested this so you need to try it a few times to make sure it produces the desired results.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.