Facing a problem in enthalpy calculation If 1 mole of gaseous carbon atoms are converted into diamonds, calculate enthalpy change of process given that bond enthalpy of $\ce{C-C}$ bond is $\pu{400 kJ mol-1}.$


According to me, the answer should be that since C(diamond) has 4 bonds and C(gas) doesn't have any bonds, 4 bonds are being formed so enthalpy change should be 

$$ΔH = 4\cdot (\pu{-400 kJ mol-1})$$

But in the correct solution it says each bond is counted twice, so answer will be 

$$ΔH = \frac{4\cdot (\pu{-400 kJ mol-1})}{2}$$

I don't get why are we doing this. In other questions we don't consider the double counting of bonds. For example, another question I did had 1 mole phosphorus gas converting into $\ce{P4}$ molecule, and even though $\ce{P4}$ has 6 bonds, we did not consider what we did with diamond, so what is the reason for that?
$\ce{P4}$ forms a molecular solid, whereas diamond is a covalent-network solid (see eg definitions here).

In a molecular solid, molecules containing a discrete number of covalently bonded atoms are arranged in a lattice stabilized by weak interactions such as van der Waals forces or hydrogen bonds between the molecules. In a covalent-network solid, the "molecules" are extended with no finite stoichiometry definining a molecular size. 

When estimating the enthalpy change, you consider only covalent bonds, not weak intermolecular forces. Therefore, for $\ce{P4}$ you consider only the 6 P-P bonds, whereas in diamond you consider covalent bonds to nearest neighbours, and correct for the fact that when you rupture a bond to a neighbour, that neighbour also loses a bond, therefore the division by 2.