Hello,
I am correctly working a project that sends an array to a function but the fuction receives it as a pointer. Below is an example of code similar to what is in the project.
int main()
{
unsignedchar myStr[] = "test";
read(&(myStr[4])); //you requested to to read address of a single char
}
//***********
void read(char pBuffer) //use char argument
{
cout << pBuffer<<endl;
}
read(myStr[4]); //will print a single char
}
#include <iostream>
usingnamespace std;
void ParseMsg(unsignedchar* pBuffer);
void ProcessMsg(void* pBuffer);
int main()
{
unsignedchar myStr[] = "test";
ProcessMsg(&(myStr[4]));
}
void ProcessMsg(void* pBuffer)
{
ParseMsg((unsignedchar*) pBuffer);
}
void ParseMsg(unsignedchar* pBuffer);
{
cout<<p<<endl;
// this is not in the project code but I want to
//read the data at this point, I am not getting
//anything. Do you know the reason that I am not getting "test" at thtis point.
}