Charles, who holds the title Admiral of the Fleet, spoke of his time at Britannia Royal Naval College in Dartmouth, Devon, when he was 22 in 1971, as he attended the passing out parade for officer cadets.
The prince, 73, said: "My father [Prince Philip], as Lord High Admiral himself, was extremely proud of his links to this college, and it was here that my mother and father first met in the captain's garden, while my grandfather, King George VI, carried out the inspection of your predecessors.
"For myself, it is somewhat alarming to think that 50 years ago I was standing where you are as part of Blake Division on the eve of my own naval service, which, to this day, I still look back on with great fondness and pride.
What is happening where you live? Find out by adding your postcode or visit InYourArea
"The lessons I learnt remain with me through the decades and I certainly sat more upright than usual when arriving this morning."
After training at the college, Charles served on the guided missile destroyer HMS Norfolk and two frigates, HMS Minerva and HMS Jupiter.
He then qualified as a helicopter pilot and flew a Wessex Mk5 with 845 Naval Air Squadron from the Commando carrier HMS Hermes.