This question may looks silly, but please guide me I have a function to convert long data to char array
void ConvertLongToChar(char *pSrc, char *pDest)
{
    pDest[0] = pSrc[0];
    pDest[1] = pSrc[1];
    pDest[2] = pSrc[2];
    pDest[3] = pSrc[3];
}
And I call the above function like this
long lTemp = (long) (fRxPower * 1000);
ConvertLongToChar ((char *)&lTemp, pBuffer);
Which works fine. I need a similar function to reverse the procedure. Convert char array to long. I cannot use atol or similar functions.
 
     
     
     
     
     
     
     
     
    