There are so many different version of this story it is hard to say which one is correct. For those who do not know,.
This is post was done by another memebr of the SC..*Kratos* But i think it will explain very well what you are asking.. Hope you don't mind my borrowing it K.
The Great writer and philosopher Voltaire had been imprisoned in the Bastille in 1717 when he was a young man. There he had a chance to talk with jailers who had known the masked man and all the gossip about him, but not his identity. Interested in discrediting the monarchy, Voltaire later concocted the theory that the masked man was Louis XIV's elder brother, imprisoned by the king to prevent disturbances over potential rival claimants to the throne.
In 1801, after the French Revolution, it was rumored that the prisoner was Louis XIV himself, displaced on the throne by his illegitimate half-brother. In prison he married (not uncommon ni those days), the story went on, and the fathered a son who was taken to Corsica, where he grew up and became the grandfather of Napoleon Bonaparte. This version, which served to link France's revolutionary decatur to the old regime, has never been taken seriously by scholars.
The most famous treatment of the story was that of Alexander Dumas pere, who altered Voltaire's version, making the prisoner the king's twin brother, and also changed the material of the mask. His romance, entitled "The Man in the Iron Mask", was published in 1848. Folklore and movies have propagated this story, although it has been totally dismissed by historians.