If an electronic keyboard or a well-tuned piano is available, this can also be an easy way to tune the guitar. Be aware that guitar music actually sounds one octave lower than written, so the highest guitar string, for example, is only the E above middle C, not the E an octave and a third above middle C, as it is written.
Pianos and keyboards give a precise, clear, loud pitch that is easy to tune to. This can be a good choice for beginners who have a keyboard available, or for guitarists who are going to be practicing or performing with a keyboard player.
Obviously, this method is not useful when a keyboard is not available. But there is also the issue of exactly how you want your guitar to be tuned. Keyboards use equal temperament, which is basically the official tuning system of modern Western music. This tuning system became so popluar and widely used, in fact, because it is so good for keyboard instruments; it is designed so that an instrument that uses it will play equally in tune no matter what key it plays in. This is very important for instruments like pianos and harps which cannot retune easily or quickly.
There is a trade-off, though. In order for equal temperament to work, the only interval that is true to natural harmonics is the octave. All other intervals are a little off from the pure intervals found in the harmonic series (in other words, in nature, in the physics of sounds). For example, a perfect fifth in equal temperament is just a little smaller than a pure perfect fifth.
Because piano is such a popular instrument, most listeners are comfortable with equal temperament. And yet, there is the fact that the intervals are not exactly "in tune". Musicians who can make small tuning adjustments very quickly ( vocalists, woodwind and brass players, and even players of unfretted strings, like the violin), often find themselves abandoning equal temperament when they can, and adopting the pure thirds and fifths of just intonation.
You cannot tune a guitar instantly, as you can a voice, or even a (non-open-string) note on the violin. But you can tune a guitar relatively quickly; say in between songs. And guitar players rarely need or want to play equally in tune in all keys. Most guitar music favors easy-to-play keys, like E minor or D major, and avoids keys that require lots of bar chords, like A flat major or C sharp minor. So most guitarists do not use equal temperament tuning.