title: C++ if(Array[x].length > 0)
body: <p>I'm trying to make a simple database program that gives users the ability to add, remove, and edit string variables.</p>
  
  <p><strong>The issue I ran into: Assigning each added variable to the next empty array element.</strong></p>
  
  <p>-I'm using static arrays for now until I learn more about dynamic arrays.</p>
  
  <p>-Since this is out of context I recreated the code here to make more sense, sorry if I missed anything.</p>
  
  <pre><code>//static array declaration
  std::string names[5];
  
  //string selection from main function
  std::string stringSel = "Item";
  
  //boolean condition for loop
  bool completed = false;
  
  //if (names[x].length &gt; 0) then increment x by 1 until names[x].length == 0 and then set that array element to the value from stringSel
  int x = 0
  while(completed == false)
  {
      //if the length of the element is greater than zero characters, increment the element
      if (names[x].length &gt; 0)
      {
          x++;
      }
      //if the length of the element is not greater than zero characters, set the string to that element
      else
      {
          //The empty element is assigned the string and the entire array prints out
          names[x] = stringSel;
          std::cout &lt;&lt; stringSel &lt;&lt; " was added to the database.\nThis is the printout of all current items: " &lt;&lt; names;
          completed = true;
      }
  }
  </code></pre>
  
  <p>The error I'm getting is coming from my if-statements condition. The '.' is underlined red</p>
  
  <p><strong>1 IntelliSense: a pointer to a bound function may only be used to call the function</strong></p>