I'm new to C, so I apologize if the answer is obvious, I've searched elsewhere.

the libraries I'm including are:

#include &lt;unistd.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;sys/wait.h&gt; 
#include &lt;fcntl.h&gt;
#include &lt;sys/stat.h&gt;


the code that is failing is:

    char *USER = getlogin();
    char CWD[128];

    if (USER == NULL)
        printf("cry\n");

    getcwd(CWD, sizeof(CWD));
    printf("this prints\n");
    printf(USER);
    printf("this does not\n");
    printf("%s@myshell:%s&gt; ", USER, CWD);


cry does not print, so that should mean that getlogin is successful.  the segfault is caused on printf(USER);

further testing shows that the folling block prints entirely

    printf("this prints\n");
    printf(USER);
    printf("this prints\n");


but the folling block will print this prints end then segfault without showing USER

    printf("this prints\n");
    printf(USER);


EDIT:

Sorry for wasting your time.  I accidentally deleted an fgets that was supposed to follow it and that was causing the segfault.  I've been on this bug for a couple hours now, I love it when the problem is so small.

Thanks


Question: Change in Wavelength of a Photon Relation to Energy (specifically Compton Effect)
Answer: One common way that this happens is through spontaneous parametric down-conversion.

From Wiki: an important process in quantum optics, used especially as a source of entangled photon pairs, and of single photons. A nonlinear crystal is used to split photons into pairs of photons that, in accordance with the law of conservation of energy, have combined energies and momenta equal to the energy and momentum of the original photon, are phase-matched in the frequency domain, and have correlated polarizations.

Say an example of a photon dropping from λ1 to λ2:
* a green photon λ1=630 nanometers, hc/λ1 = 1.97 evolts
* splits in two and one photon is λ2=830 nanometers, hc/λ2 = 1.49 evolts

The difference in energy, hc/λ1-hc/λ2 = 0.48 evolts and would end up with the other photon. the other photons wave length would be 2583 nanometers based on its 0.48 evolts energy.

The difference you reference Δλ = λ2−λ1 of 200 nanometers converted to hc/Δλ is quite high at 6.2 evolts. There is not much sense to the quantity hc/Δλ and I dont think there is any particular meaning to it.