Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Warning.-Array subscript is above array bonds
QtWS25 Last Chance

Warning.-Array subscript is above array bonds

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 472 Views
  • 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.
  • D Offline
    D Offline
    Daniel Acosta
    wrote on last edited by
    #1

    mat.push_back((valoresA[2]*valoresA[2]*cos(angulosTeta[1])*cos(angulosTeta[2]))+(valoresA[3]*cos(angulosAlfa[1])*cos(angulosAlfa[2])*cos(angulosAlfa[3]))-(valoresA[3]*cos(angulosAlfa[1])*sin(angulosAlfa[2])*sin(angulosAlfa[3]))), my program crashes after a few intents, I'm using the UI and calling this function from mainwindow.cpp, i have no errors, only this warning, it's a value stored in a vector<double> mat;

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      I have seen this if i use old c arrays and
      use them as parameter where i pass as pointer to first element.
      Its impossible to guess from the code snippet as it could be
      any of the valoresA, angulosTeta etc.

      You could split all the array access into variables, as it should show what
      line warning comes at.
      There is no other info in the warning ?

      ps. like this
      https://stackoverflow.com/questions/12785097/c-and-gcc-error-array-subscript-is-above-array-bounds

      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