Yes, Stendhal served in the military. He joined the army in 1802 and served for six years, mostly in Italy. His military experiences influenced his writing, particularly his novel The Red and the Black.
Unlocking Stendhal: Exploring the Enigmatic World of the French Literary Genius