Clear an Array? how to clear array



  • i have an array that should be cleared if any number inside is not greater than 300.

    I have a device that sends data continuously to the QT GUI. And the array records them continuously into it.
    And i start my project if any of number greater than 300 comes.

    So array size becomes larger than array limit as time goes by and stopped working appears so i should do force stop.

    so need to clear the array if any number inside the array is not greater than 300.

    (i can not record data into array after number greater than 300 appears by some issue..........do not offer me that.)

    tool++;
    wave12[tool]=ps[0];

    Just i need to know how to clear or resize or reinitialize or any other thing that make it empty or .......

    any example please?


  • Moderators

    Hi,

    What is your array type? If you use QVector, call QVector::clear()

    http://qt-project.org/doc/qt-5/qvector.html#clear (read the whole page to learn how to use QVector)



  • Dynamic array is from STL or Qt?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.