Roald Dahl started writing because he was encouraged to do so by author C.S. Forrester. Dahl is quoted as saying to Willa Petscheck of the New York Times, "[w]ithout being asked to, I doubt if I'd ever have thought to [start writing]."
Dahl's early works were realistic in nature and for adults, quite different from the children's stories he is known for writing. Dahl was a fighter pilot in World War II, and his early writings include detailed accounts of the war. In these accounts, he showed an early aptitude for writing to Forrester. It was Forrester who jump started Dahl's career.
Dahl did not start writing for children until after he had children of his own. Dahl's children's novels were sometimes extended versions of bedtime stories he told to his children. It was the response of his children to these bedtime stories that pushed Dahl to write full-length novels for children. Dahl wrote all of his children's novels in a secluded hut in his garden.
Before finding success as a children's author with "James and the Giant Peach" in 1961, Dahl wrote "The Gremlins" for Walt Disney in 1942. Because "The Gremlins" did not find success, Dahl shifted his focus back to adults before he ultimately found success with children's literature.