-
September 9th, 2009, 05:48 AM
#1
error C2664 : cannot convert parameter from WORD' to 'WORD' 2 from
I am trying to transmit by reference a Struct type parameter, but i get the following error:
error C2664 : cannot convert parameter 2 from 'TextFrameworkEngine::WORD' to 'WORD'
My code is quite simple :
test.h
Code:
struct WORD {
string text;
}
test.cpp
Code:
bool findWord(WORD &findWord){
// if the word is found in the current text, fill the findWord fields
return true;
}
void findAll() {
WORD findworld;
findWord(findword);
}
I know it's a conversion type problem, but i do not manage to solve it. Do you have some suggestions?
Best wishes,
D.M.
Last edited by munteanu24d; September 9th, 2009 at 05:53 AM.
-
September 9th, 2009, 05:55 AM
#2
Re: error C2664 : cannot convert parameter from WORD' to 'WORD' 2 from
Looks like there's another type named WORD out there somewhere. Try another name.
-
September 9th, 2009, 08:04 AM
#3
Re: error C2664 : cannot convert parameter from WORD' to 'WORD' 2 from
or use your own namespace to define the WORD in.
-
September 10th, 2009, 07:48 AM
#4
Re: error C2664 : cannot convert parameter from WORD' to 'WORD' 2 from
If you're using Windows, there is already a typedef called WORD, along with BYTE & DWORD.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|