Not the function prototype, the actual code for the ReadComn function.
If the parameter you're passing into the function needs to be changed then you need to pass an address (a pointer) to whatever you plan on changing. If what you plan on changing is already a pointer, then you need to pass in a pointer to a pointer and inside the function that will be making the change you'd modify it's value (such that the value is changed in the calling function) by doing like matsp stated above. This does not mean that you stick a & in front of every array/pointer variable in your code:
Some examples of you missuse of &... Assuming InBuf is declared as an unsigned char*, then:
Code:
// This is fine as long as the pointer InBuf needs to be modified by the ReadComn function
// and the function is defined to accept an unsigned char** and not an unsigned char*.
// In the function, you'd change its value by doing *buf = something
iReadReturn = ReadComn(iComBalanca, &InBuf, iLenBuf);
...
// This is likely incorrect, the function is declared as taking an unsigned char* but &InBuf in this
// case is a unsigned char** notice the extra *. Does ProcessaBuffer also need to modify the
// pointer's value? If it does, then the function needs to accept an unsigned char** like ReadComn
// If not, then you certainly don't want to use the &
ProcessaBuffer (&InBuf);
................
int strrpos (unsigned char *pStrText, char pChar){ // Última ocorrência do caractere.
int iLen, iCont;
iLen = strlen (pStrText);
// This is incorrect, you use it correctly above with the strlen function (without the &)
// but then you mess it up by putting the & back in here.
printCom1 ("\nSTR.: %s", &pStrText);
printCom1 ("\nLEN.: %d", iLen);
.........
void ProcessaBuffer (unsigned char *pInBuf){
char cChar;
unsigned char *cPacote, *cPeso;
unsigned char *cStatus;
unsigned char cByte;
int iCont;
int iPosStart, iPosEnd, iPosTam;
cChar = STARTCHAR;
// This here needs to change to just pInBuf. pInBuf is an unsigned char*.
// &pInBuff would therefore be a unsigned char** but the strrpos function accepts an unsigned char*
// You'd therefore need to use just pInBuf instead.
iPosStart = strrpos (&pInBuf, cChar);
...