Diplodocus had a long neck that it would have used to reach high and low vegetation and to drink water. There has been some debate over how such a long neck would have been held.
Scientists now think that ligaments running from the hip to the back of the neck would have allowed Diplodocus to hold its neck in a horizontal position without using muscles.
Source