I am unsure what you mean by 40x1 pinhead connector separate.
If you mean male headers, most of the electronics stores and ebay sell these in groups of 16-40 pins, that you can break off as many as you need for a particular project. These are made so you can solder in the small end to a PCB board, and use the long end to attach to the female header pins on most Arduino boards and shields. Here is the Adafruit version of the headers: http://www.adafruit.com/products/392
I tend to like the Adafruit longer version of the male header, that you can put the header into a standard breadboard, and have enough room that you can attach a female jumper pin: http://www.adafruit.com/products/400
. These are harder to find than the standard pins above.
You can also get the female version made for soldering to pcb boards to allow male pins to be attached: http://www.adafruit.com/products/598
If you are building a shield to mount on your Arduino, you can use female stacking pins, such as: http://www.adafruit.com/products/85
An alternative to the female mounting pins are female machine round headers, that tend to hold solid wires a little bit better (but probably not stranded wires unless you tin them): http://www.dipmicro.com/store/HDR40X1FM
There is a male version of the machine rounded pins as well: http://www.dipmicro.com/store/HDR40X1MM
If you are wanting to make cables of custom lengths, you might go to the crimp connectors from pololu: http://www.pololu.com/catalog/category/19
If you are wanting to have removable connectors that are soldered to perfstrips, and you want to make custom wires, you might consider these wafer kits from dipmicro: http://www.dipmicro.com/store/SET-HDR
Often times, these parts by themselves aren't that expensive, but you pay a lot more for shipping. So, I tend to group them in with other orders to cut down on the cost.