Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:05:49+00:00 2026-06-13T21:05:49+00:00

I have two classes, one called Grocery and the other one called Strings In

  • 0

I have two classes, one called Grocery and the other one called Strings

In the Grocery.cpp I’m trying to use a function from the “Strings” class called : “copyString” and I get the following error:

identifier “copyString” is undefined

The “Strings” class is just a generic Class for the base string function such as : strcmp, strcpy and so on….

In the “Grocery” class I don’t want to create a “Strings” object but using It like a the “Math” class is being used in C#. Just indicating the class name and using a dot to call a function of the Class.

How can I create a class “Strings” with the same functionality as the “Math” class in C# I described above?

Thanks a lot!
Guy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:05:50+00:00Added an answer on June 13, 2026 at 9:05 pm

    Either you have a class Strings, with a method getStringLength(), in which case you need to call getStringLength() on a Strings instance:

    Strings s = ....;
    s.getStringLength();
    

    or you have a namespace Strings with the method, in which case you need to call it like this:

    Strings::getStringLength();
    

    If the function is not related to the Strings class, consider making it a non-member function, in a suitable namespace:

    Strings.h:

    namespace StringFunctions
    {
      int getStringLength();
    }
    

    Strings.cpp:

    StringFunctions::getStringLength() { return 42; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes one of which inherits from the other. Im trying to
I have two classes, one that inherits from the other. The base class is
I have the following two classes, one inherits from the other Class A{ void
I have two classes (MVC view model) which inherits from one abstract base class.
Hi I have two classes, one called Instruction, one called LDI which inherits from
I have two arraylists, one contains Strings and the other contains Classes that have
So I have two classes. One is a class called Main. The Main class
I have two java classes called Reader and Worker. Reader reads strings from a
I have two classes one called Person the other called Student I have been
I have two classes one the Driver and the other one called FilterOut. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.