hi,while compiling the following c++ code i got the following error please help
me to resolve this error.
file: ip1.cc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tclcl.h>
struct ipnode /* To Store Node Information */
{
char ip[15];
}node[10];
class ip: public TclObject {
public:
ip();
protected:
int command(int argc,const char*const* argv);
private:
char address[10][15];
void setIP(int i,char a[]);
};
static class ipClass : TclClass {
public:
ipClass();
TclObject* create(int,const char*const*)
{
return (new ip());
}
}class_myip;
ip::ip()
{
bind("ip",&ip);
}
int ip::command(int argc,const char*const*argv) {
Tcl& tcl=Tcl::instance();
if(argc==4) {
if(strcmp(argv[1],"setIP")==0){
setIP(argv[2],argv[3]);
return(TCL_OK);
}
}
return(ip::command(argc,argv));
}
void ip::setIP(int i,char a[]) {
strcpy(ip[i],a);
}
ERROR::::
ip1.cc: In constructor `ip::ip()':
ip1.cc:30: error: expected primary-expression before ')' token
ip1.cc: In member function `void ip::setIP(int, char*)':
ip1.cc:45: error: expected primary-expression before '[' token
with regards,
N.ArunKumar
Unlimited freedom, unlimited storage. Get it now, on
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/