新微赢技术网

标题: 【求助】新手学习C++,第一个程序有问题 [打印本页]

作者: 梦的放肆    时间: 2009-11-4 01:23
标题: 【求助】新手学习C++,第一个程序有问题
#include  <afxcoll.h>    //Provides Access to MFC functions
Class CDrawBox : public CObject
{
public :
// Draws the box.
void DoDraw(char * string);
}
void CDrawBox :: DoDraw(char * cValue)
{
int      iCount;    //Loop counter
int      iSpace;    //Amount of spaces to add for string.
// Draw the top of the box
fprintf(stdout,"\311");
for (iCount = 1;  iCount <= 78 ; iCount ++)
{     
  fprintf(stdout,"\315");
}
fprintf(stdout,"\273");
// Figure out the center of the string, then display it with the box sides.
iSpace = (80 - strlen(cValue)) / 2;
fprintf(stdout,"\272");
for (iCount = 1;  iCount <=  iSpaces ; iCount ++)
{     
  fprintf(stdout,"  ");
}
fprintf(stdout, "%s", cValue);
// Compensate for odd sized strings, then complete the side.
if ((strlen(cValue) % 2) == 1)
{     
  iSpaces --;
}
for (iCount = 1;  iCount <=  iSpaces ; iCount ++)
{     
  fprintf(stdout, "  ");
}
fprintf(stdout,"\272");
//




欢迎光临 新微赢技术网 (http://bbs.weiying.cn/) Powered by Discuz! X3.2