title: How to create an array of dictionaries?
body: <p>new to programming!</p>
  
  <p>I'm trying to create an array of dictionaries inside a struct in Swift like so:</p>
  
  <pre><code>var dictionaryA = [
      "a": "1",
      "b": "2",
      "c": "3",
      ]
  var dictionaryB = [
      "a": "4",
      "b": "5",
      "c": "6",
      ]
  var myArray = [[ : ]]
  myArray.append(dictionaryA)
  myArray.append(dictionaryB)
  </code></pre>
  
  <p>This works fine in a playground, but when I put it into an Xcode project, inside a struct, the lines with the append function produce the error "Expected declaration".</p>
  
  <p>I've also tried using the += operator with the same result.</p>
  
  <p>How can I successfully construct this array inside the struct?</p>