These 0.1″/2.54mm-pitch header strips are commonly used as low-cost connectors. The single-row header strips can easily be snapped into smaller strips to fit your application. The double- and triple-row strips can also be broken into smaller strips, but it takes a little more effort, and it is sometimes easier to use wire/diagonal cutters. This Male Header / Male connector has 40 pin in a single row.
Male Header 40*1 Pin