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

  • SEARCH
  • Home
  • 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 7601951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:17:21+00:00 2026-05-30T23:17:21+00:00

I am very new to C++, coming form Java and C. My book does

  • 0

I am very new to C++, coming form Java and C. My book does not mention private functions and Google searches don’t turn up much. This should be trivial for me, but I can’t get it to work.

I have this code:

#ifndef RUNDATABASE_H
#define RUNDATABASE_H
#include <iostream>
#include <string>

class RunDatabase
{
    public:
        int main();
    protected:
    private:
        bool checkIfProperID(std::string);
};

#endif // RUNDATABASE_H

And in another file:

#include "RunDatabase.h"

int main()
{

    std::string id; // after this, I initialize id

    if(!checkIfProperID(id))
    {
        std::cout << "Improperly formatted student ID, must be numeric" << std::endl;
        break;
    }

}

bool RunDatabase::checkIfProperID(std::string id)
{
    return true;
}

I get this error: error: 'checkIfProperID' was not declared in this scope

Using MinGW g++ 4.4.1 on Windows 7 64 bit.

Thanks for any help.

  • 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-05-30T23:17:23+00:00Added an answer on May 30, 2026 at 11:17 pm

    checkIfProperID is a method of RunDatabase. This means you need to have a RunDatabase object in order to call checkIfProperID.

    RunDatabase rd;
    rd.checkIfProperID(id);
    

    I don’t see why the other function is not in the scope.

    The “scope” here is the class.

    RunDatabase::checkIfProperID
    

    Notice the scope-resolution operator ::. This means that the method belongs to the class, not global scope.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Python (I'm coming from a JAVA background) and I'm wondering
I'm very new to Windows Form programming, and I'm coming across a problem. I
I'm coming from web forms and still very new to MVC. I want to
I'm coming from C# and very new at this so please bear with me.
I'm soon going to check in the very first commit of a new Java
Very new to FluentNHibernate, but I'm also excited about the area. I've recently started
Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
Im very new to SQL but need to write a query to do the
I very new to Python, and fairly new to regex. (I have no Perl
Warning - I am very new to NHibernate. I know this question seems simple

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.