error in festvox c++ programming

#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
 
#include <string.h> 
or
 
#include <cstring> 


Definitely not
 
#include "cstring.h" 
Last edited on
thanks for your quick response

but it still not working
Last edited on
but it still not working
What's wrong?
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
closed account (Dy7SLyTq)
post ur code
1
2
3
4
5
6
7
8
9
10
#ifndef include
#define include
#include "header.h"
#include "cstring.h"
#include <cstdlib>


#endif

class wrdC {...


Move this #endif to the end of your file.
closed account (Dy7SLyTq)
no. either #include <string.h> or #include <cstring>
OP has said he already did that.
closed account (Dy7SLyTq)
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
closed account (Dy7SLyTq)
remove the string.h line
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.
Thank u For Work It.
fdgdfgfda
gfhsfdfcxzdscxg
Thank's For Use It.
Topic archived. No new replies allowed.