This paper proposes a new evolutionary method for generating ANNs. In this method, a simple real-number string is used to codify both architecture and weights of the networks. Therefore, a simple GA can be used to evolve ANNs. One of the most interesting features of the technique presented here is that the networks obtained have been optimised, and they have a low number of neurons and connections. This technique has been applied to solve one of the most used benchmark problems, and results show that this technique can obtain better results than other automatic ANN development techniques.