That's more like Lamarck; though in my ignorance I shouldn't be saying anything about how 'adaptation' takes place in Darwin.
One thing of which I'm more or less certain, and it's that *advantageous traits help survive*, they aren't 'developed for a purpose'. The necks of Giraffes don't adapt to higher tree branches----rather, those with the longer-neck-traits thrive, and hence determine how the species is to continue surviving.