I”m working on a project for class, but keep getting the error: no instance of overloaded function matches argument list. It is referencing my String classes. What I am trying to do is create a Copy, Concat and Count functions with out using the string class. Any help would be greatly appreciated.

#define _CRT_SECURE_NO_WARNINGS#include #include using namespace std;class String{private:char str<100>; char cpy<100>;public:static const char NULLCHAR = “”;String(){ str<0> = NULLCHAR; cpy<0> = NULLCHAR;}String(char* orig, char* cpy){ Copy(orig, cpy);}void Display(){ cout

Đang xem: No instance of overloaded function matches the argument list

*

It looks like your Copy and Concat functions each take two parameters, yet you pass them both a single parameter. If you want to copy them into a String object, your code should look more like:

String Copy(char* orig){ // Same copy logic you have, // except copy into “*this”}

*

As the error message says, There is no version of the constructor for your String class that takes a single parameter. You have a default constructor and one that takes two parameters.

You need to define one which takes a single parameter and initializes the str

*

String s4(“This String built by constructor”);this statement needs construction function

String(char *);

Read more: Haskell Indian Nations University Pow Wow, Haskell To Host Its First &#8216Two

*

Thanks for contributing an answer to Stack Overflow!

Please be sure to answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

How to convert a char* to a generic data type using one function only or/and an overload operator conversion?

*

Read more: Returning To Wow Can'T Teach On An Empty Stomach, Getting Started On Your Free Trial

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.4.22.39130

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Previous articled&d 5e hail of thorns
Next articlelove is never having to say you re sorry

LEAVE A REPLY

Please enter your comment!
Please enter your name here