c++ - error C2143:Syntax error: lack of ";" (in front of the ". ") -


i try call huffmantree1.createhfmtree(char str,int m,int n);in button function .when run give me error c2143: syntax error: lack of ";" (in front of ". ").

it's translation of 语法错误 : 缺少“;”(在“.”的前面)

my code below:

void chuffmantreedlg::onbnclickedbutton1() {      // todo: 在此添加控件通知处理程序代码     updatedata(true);     if (m_radio1=1)     {         char*pszfilename="c:\c++\huffmantree\huffmantree\wdata.txt";         cstdiofile myfile;         cfileexception fileexception;         if(myfile.open(pszfilename,cfile::modecreate|cfile::typetext|cfile::modereadwrite),&fileexception)         {   afxmessagebox("打开成功");         myfile.seektobegin();         cstring str1;         myfile.readstring(str1);         cstring str2;         afxmessagebox(str1+str2);         ifstream ifs("wdata.txt");         ofstream ofs("wcode.txt");          char str[1000];          char str[100];          int i=0,j,m[100],h,k=0;          int n=0;          char ch;          while(ifs.get(ch))          {              if(ch!='\n')              {str[n++]=ch;}             for(i=0;i<n;i++)              {                  j=0;h=0;                  while(str[i]!=str[j])                      j++;                  if(j==i)                  {                      str[k]=str[i];                   }                  else                      continue;                  for(j=i;j<n;j++)                  {                      if(str[i]==str[j])                          h++;                  }                       m[k]=h;                  k++;              }              huffmantree1.createhfmtree(char str,int m,int n);              cin.get();              m_length=n;             m_string1="报文的编码已经保存在wcode.txt";             updatedata(false);         }         }         else         {             trace("can't open file%s,error=%u\n",pszfilename,fileexception.m_cause);         }         myfile.close();     }    } 

thanks :d

this line:

huffmantree1.createhfmtree(char str,int m,int n);  

is odd. more or less function declaration, lacks return type. isn't call function; you'd not list types. if you're trying call function, drop char, , 2 int, , maybe rename other arguments. don't see class variable huffmantree1 code can using — makes global variable, or 1 otherwise defined out of function. sure that's interface design? passing values functions in parameters better using 'global' variables.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -