0

I'm knew to C++ and I always seem to have a problem but all I want to do is to pass an Object to a function by reference..
Thanks in advance
Oh I user boost for directories, paths and files... Also I use c strings for UserName and password as I need to have a limit on what the user enters... ()
The Error messeage is this on Codeblocks/Migw Gcc :error: cannot call member function `bool CUser::createUser(CUser)' without object|

class CUser
{
    public:

        CUser (  ) {
            fs::path config_PATH( fs::initial_path<fs::path>() );
            m_configurationFile_PATH = config_PATH;

            m_userName     [ 0 ] = '\0';
            m_userPassword [ 0 ] = '\0';
        }
        ~CUser ( ) {

        }
        bool createUser ( CUser NewUser );
        //friend char *getcstring (  char *str , const int size, const string msg  );

    private:

             fs::  path          m_configurationFile_PATH;       // Configuration file's Path
                   char          m_userName     [ 25 ];          // UserName to login
                   char          m_userPassword [ 25 ];          // User password to login

};
int main ()
{
    CUser currentUser;
    CUser::createUser ( currentUser );
[/B]
}
bool CUser::createUser ( CUser NewUser /* CUser Object -> Creating a new user */ )
 {
    const string userNamePrompt_Msg     = "Enter User Name";            // Prompt messages for user
    const string userPasswordPrompt_Msg = "Enter User Password";        // input.
    const string configurationFile_FN   = "User_Information.ini";       // Configuration file's Filename
    int t [ 6 ] = { 0 }; /* Tests return value of Functions */



    string file_attributes_CMD; /* Changes config...file_FN file attributes */

    fs::ofstream  blank_FILE; /* Creates a new user file */

    getcstring ( m_userName, SIZE_A, userNamePrompt_Msg ); /* Prompts user to enter a name and password */

    getPasswordReturn ( NewUser.m_userPassword, SIZE_A, '*',
                        /*BlRED,*/ userPasswordPrompt_Msg );
return true;// just part of the function so you can see what i'm doing...
}
1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by ShortYute
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.