What's wrong with this C++ program? -


i have header file , and .cpp file passing value function gives me error

main.c

#include "me.h" #include <iostream> #include <sstream> #include <string.h> using namespace std;  int main() {     me("http"); } 

me.h

#ifndef me_h_ #define me_h_ #include <string.h> class me { public:     me(std::string u);     virtual ~me(); };  #endif /* me_h_ */ 

me.cpp

#include "me.h" #include <iostream> #include <string.h> using namespace std; me::me(std::string u) {     // todo auto-generated constructor stub cout << "help"; }  me::~me() {     // todo auto-generated destructor stub } 

i getting error

in file included ../src/me.cpp:8: ../src/me.h:13: error: expected ‘)’ before ‘u’ ../src/me.cpp:12: error: prototype ‘me::me(std::string)’ not match in class ‘me’ ../src/me.h:11: error: candidates are: me::me(const me&) ../src/me.h:11: error:                 me::me() make: *** [src/me.o] error 1 

#include <string> instead of #include <string.h>

string.h c string header, accessible in c++ <cstring>

<string> c++ header defines std::string


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -