title: How to return array of address in solidity?
body: <h3>I am creating a smart contract in solidity ^0.5.1 in which I am getting Error.</h3>
  
  <p>Gives Error.</p>
  
  <p>data location must be a memory for the return parameter in the function, but none was given.</p>
  
  <p>In the below function I am getting error.</p>
  
  <pre><code>function getCitizen()public returns(address[]){
      return citizenArray;
  }
  </code></pre>
  
  <p>the smart contract that I have tried so far.</p>
  
  <pre><code>  pragma solidity ^0.5.1;
  </code></pre>
  
  <p>contract Citizen{</p>
  
  <pre><code>struct Citizens{
  
      uint age;
      string fName;
      string lName;
  
  }
  
  mapping(address =&gt; Citizens) citizenMap;
  
  address [] citizenArray;
  
  function setCitizen(address _address,uint _age,string memory _fName,string memory _lName) public{
  
      //creating the object of the structure in solidity 
       Citizens storage citizen=citizenMap[_address];
  
  
      citizen.age=_age;
      citizen.fName=_fName;
      citizen.lName=_lName;
  
      citizenArray.push(_address) -1;
  
  }
  
  function getCitizen(address _address) public pure returns(uint,string memory ,string memory ){
      return(citizenMap[_address].age,citizenMap[_address].fName,citizenMap[_address].lName);
  
  }
  
  function getCitizenAddress()public returns(address[]){
      return citizenArray;
  }
  
  }
  </code></pre>
  
  <p>thanks in advance for the help.</p>