Nominate our 2022 Qt Champions!

Stack small array in big array

  • Hello Guys,
    I have one question
    with a timer I am generating and array of 100 elements and I want to store it in an big array of 1000 elements. But when second timeout has occurred I want to store the new array of 100 elements in the same big array but from index 100 so that after 10 timeouts I will have 1000 elements in the big array.
    I am using following method but getting error

    int samplesPerSecond=1000;
    dataCounterBigArray =(uInt32*) calloc ((samplesPerSecond), sizeof(uInt32));
    This is slot from timer timeout
    void manualMode::getCounterData()
    /*Note-Length of readCouterData is 100*/
        memcpy(dataCounterBigArray, readCounterData, sizeof(uInt32)*0.1*samplesPerSecond);

    But i am getting error can any one help me with this.

    [Added code tags ~kshegunov]

  • @rockon209 said in Stack small array in big array:

    But i am getting error

    And the error says what?

Log in to reply