Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Stack small array in big array
Forum Updated to NodeBB v4.3 + New Features

Stack small array in big array

Scheduled Pinned Locked Moved Unsolved C++ Gurus
2 Posts 2 Posters 871 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rockon209
    wrote on last edited by kshegunov
    #1

    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;
    uInt32*dataCounterBigArray=NULL;
    dataCounterBigArray =(uInt32*) calloc ((samplesPerSecond), sizeof(uInt32));
    double*readCounterData;
    This is slot from timer timeout
    
    void manualMode::getCounterData()
    {
        readCounterData=ni6002.readCounter(0.1*samplesPerSecond);
    /*Note-Length of readCouterData is 100*/
        memcpy(dataCounterBigArray, readCounterData, sizeof(uInt32)*0.1*samplesPerSecond);
        dataCounterBigArray+=100;
    }
    

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

    [Added code tags ~kshegunov]

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @rockon209 said in Stack small array in big array:

      But i am getting error

      And the error says what?

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved