while (p = getline(pFile))
{
if (ulCurrLines >= ulAllocedLines)
{
// * 当前竖向空间已经不够了,通过realloc对其进行扩展。
ulAllocedLines += 50; // 每次扩展50行。
ppText = realloc (ppText, ulAllocedLines * (char *));
if (NULL == ppText)
{
return; // 内存分配失败,返回
}
}
ppText[ulCurrLines++] = p; // 横向“扩展”,指向不定长字符串
}