Hi Guys,
I have a segment of code here that I am not able to analyze
[code=cpp]
template <typename FieldType>
int CheckHeaderFiel d(
FieldType& field, const char* buffer, unsigned long bufferSize,
bool continueParse
)
{
const char* fieldptr = reinterpret_cas t<const char*>(&field);
const char* endptr = buffer + bufferSize;
AliHLTUInt32_t bufferRemaining = endptr > fieldptr ? endptr - fieldptr : 0;
/*....And the rest of the code here*/
}
[/code]
What is the meaning of adding a variable of unsigned long to a variable of char*
I printed endptr but the output is just funny characters.
I have a segment of code here that I am not able to analyze
[code=cpp]
template <typename FieldType>
int CheckHeaderFiel d(
FieldType& field, const char* buffer, unsigned long bufferSize,
bool continueParse
)
{
const char* fieldptr = reinterpret_cas t<const char*>(&field);
const char* endptr = buffer + bufferSize;
AliHLTUInt32_t bufferRemaining = endptr > fieldptr ? endptr - fieldptr : 0;
/*....And the rest of the code here*/
}
[/code]
What is the meaning of adding a variable of unsigned long to a variable of char*
I printed endptr but the output is just funny characters.
Comment