Questions tagged [c2664]

C2264 is a Compiler Error that occurs when one tries to pass a function a parameter of an incompatible type.

C2264 is a Compiler Error that occurs when one tries to pass a function a parameter of an incompatible type.

This example generates C2264:

// C2664b.cpp
// C2664 expected
struct A {
   // To resolve, uncomment the following line.
   // A(int i){}
};

void func( int, A ) {}

int main() {
   func( 1, 1 );   // No conversion from int to A.
}
56 questions
0
votes
1 answer

C2664 conversion error

I am a beginner in programming language and need your help. I have got codes from C language which is needed to be written into C++ MFC. In C language I have codes like int32 float64 and when I put them into MFC application, they showed this…
Ashton
  • 83
  • 1
  • 3
  • 12
0
votes
2 answers

Error C2664 , need clarification

I use this function in my programm and I call it by receive(&head);.I am doing something wrong and get an error c2664 : cannot convert parameter 1 from "link **" to "link *" when calling QUEUEget(&head). If I understand it right (*head) is a link to…
user2192519
  • 41
  • 1
  • 1
  • 6
0
votes
2 answers

error C2664 due to cdecl and myclass conflict

I'm trying to join an old piece of code in C to my present VC++ project: // .h class DMSinv : public CDialog { double finte(double z); double ITFStolz(double Zp1, double Zp2, double Zc); }; // .cpp double Zcglob; …
madoro
  • 55
  • 7
0
votes
2 answers

C2664 error in an attempt to do some OpenGl in c++

Here is an abstract of my code. I'm trying to use glutSpecialFunc to tell glut to use my KeyPress function class Car : public WorldObject { public: void KeyPress(int key, int x, int y) { } Car() { glutSpecialFunc(&Car::KeyPress); // C2664…
Thorgeir
  • 3,960
  • 3
  • 24
  • 20
0
votes
2 answers

C++/CLI - Error C2664 again

I am dealing with following problem. To be formal I am using VS2010 Ultimate and I try to write an windows forms application, but I get specified error: 1>f:\baza danych\baza\baza\Form5.h(475): error C2664: 'Bazadanych::Dodaj1' : cannot …
0
votes
1 answer

Error C2664 in hid_device.h

std::string get_path( void ) { return m_devicePath; } Debug output: hid_device.h(37) : error C2664: >'std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::>_Has_debug_it)' : cannot convert parameter 1 from…
sudonym
  • 13
  • 2
-1
votes
1 answer

error : C2664 'void RecursiveDelete(LPWSTR,LPWSTR)': cannot convert argument 2 from 'const wchar_t [12]' to 'LPWSTR'

Any Idea how to fix? Would be really useful. I tried changing conformance mode to off and it worked but the other parts of the program failed. Any other fixes? Line that has problem : RecursiveDelete(path, L"desktop.ini"); Edit : The program is…
-2
votes
1 answer

in a set transform to lowcase c++ errorC2664

I'm trying to use STL function transform to transform all the strings in a set to lowcase. But I got an error of C2664. I wonder what the wrong with my code? set mydoc; mydoc.insert("ABCD"); transform(mydoc.begin(), mydoc.end(),…
-2
votes
4 answers

Error c2664 in VS 2013 C++

So, I have a class called "music" and when I try to compile the code, it gives me the following errors: Error 13 error C2664: 'music::music(const music &)' : cannot convert argument 2 from 'const char [5]' to 'char' c:\users\andrei …
user3645164
  • 3
  • 1
  • 5
-3
votes
3 answers

C2664 'cMan::cMan(char *,char *,double,int)': cannot convert argument 1 from 'const char [6]' to 'char *'

Hello I am just learning C++. I have this code but when I try to build the solution error from title shows up. Any ideas how to fix that? class cMan { public: cMan(char *chFirstName, char *chLastName, double dWeight, int iHeight); ~cMan(); …
-4
votes
2 answers

error C2664: show_info: cannot convert parameter 2 from 'char [20]' to 'char

I have a small structure: struct price { char name[20]; char shop[20]; int pr; price *next; }; A function that doesn't work: void show_info(price *&head, char cur) { bool found = 0; price *temp = new price; temp->name =…
Grafit
  • 3
  • 3
1 2 3
4