我正在寻找一些c ++代码,并且感到困惑if(ptr && *ptr),在这种情况下它做了什么?
// Process the data here. We just break the data into separate pieces and
// display it for the sake of simplicity.
char * a_pszBreak = NULL;
char * a_pszDataItem = (char*)s_aucDataBuffer;
do
{
// The poll data is terminated by either a Carriage Return alone, or a
// Carriage Return/Line Feed pair.
a_pszBreak = strpbrk(a_pszDataItem, "\n\r");
if (a_pszBreak && *a_pszBreak)
{
*a_pszBreak = 0;
a_pszBreak++;
LogPollData((const char *)a_pszDataItem);
}
a_pszDataItem = a_pszBreak;
} while (a_pszBreak && *a_pszBreak);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
749 次 |
| 最近记录: |