crossover cable
You can connect 2 PC`s without the use of a switch with a cross-over cable.
Either use a crossover cable or connect them using a hub, switch, or router.
A crossover cable.
crossover cables must be used between 2 devices from the same level like (pc & pc - Pc & router - router & router) but strait through cable used between 2 different levels like (pc & switch - router & switch )
To connect a PC to a switch you should use a straight through UTP cable.
If you are using a crossover cable, simply assign static IP's to each machine (192.168.0.2 and 192.168.0.3). If using regular network cable, you will need to use a network switch or hub to connect them together, still using the static IP's for each machine.
A crossover cable.
A hub or switch must be used to connect 3 PCs together. Two PCs can be connected using a single crossover cable.
You would need what is called a crossover cable. It is basically an ethernet cable with 2 of the wires swapped on one end. This swapping is usually done inside a switch but has to be physically done on the cable if you are trying to connect direct. You also have the option of using special USB cables to connect computers directly.
crossover cable
With a LAN cable and a switch