#ifndef include
#define include
#include "header.h"
#include "cstring.h"
#include <cstdlib>
#endif
class wrdC {
public:
int bst; //begining state number
int est; //ending state number
int nst; //no of states
int wid; //word id
char nm[nmL];
wrdC();
void init(int, int, int, int, char*);
int getbst();
int getest();
int getnst();
};
int wrdC::getbst() {
return bst;
}
int wrdC::getest() {
return est;
}
int wrdC::getnst() {
return nst;
}
wrdC::wrdC() {
}
void wrdC::init(int t_bst, int t_est, int t_nst, int t_wid, char *t_nm) {
bst = t_bst;
est = t_est;
nst = t_nst;
wid = t_wid;
strcpy(nm, t_nm);
}
i got an error in the above program as
hmmword.h: In member function ‘void wrdC::init(int, int, int, int, char*)’:
hmmword.h:87:19: error: ‘strcpy’ was not declared in this scope
please can any one help me thank you in advance
1 2 3 4
|
#ifndef include
#define include
...
#endif
|
??? You're asking for trouble.
hmmword.h:87:19: error: ‘strcpy’ was not declared in this scope |
You need
or
Definitely not
Last edited on
thanks for your quick response
but it still not working
Last edited on
hmmword.h: In member function ‘void wrdC::init(int, int, int, int, char*)’:
hmmword.h:87:19: error: ‘strcpy’ was not declared in this scope
this is the error i got executing
thank you
no. either #include <string.h> or #include <cstring>
OP has said he already did that.
no he did #include "cstring.h". correct me if im wrong but there is no cstring.h
hello every one
thanks for your response
i was tried with the following headr files
#include<string.h>
#include<cstring>
#include<string>
still it is getting the same error
You are not using a namespace:
Place this underneath the includes:
using namespace std;
Or do this for every function in the namespace std
std::some_std_function();
thank u all
it was worked.
i was declared #include<cstring> just before the main in the above program
thanks for your valuable responses.