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 7833823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:54:42+00:00 2026-06-02T12:54:42+00:00

We have derived our own Utility String class from RogueWave’s RWCString class. Derived class

  • 0

We have derived our own Utility String class from RogueWave’s RWCString class. Derived class handled numeric to string conversion through << and >> operators.

Below is declaration of this class.

#ifndef UtlString_h
#define UtlString_h 1
#include "platform.h"

#ifdef WIN32
#include "Utilities.h"
#endif

#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "rw/cstring.h"
#include "UtlIdentifier.h"

const troint64 BIGBUF_LEN = 56000L ;

class UtlString;
unsigned UtlExport gHashString (const UtlString &);


class  UtlExport UtlString : public RWCString  
{
  public:
      UtlString ();
      UtlString (char c);
      UtlString (char c, size_t N);
      explicit UtlString (const char* cs);
      UtlString (const char *cs, size_t N);
      UtlString (const RWCString& str);
      UtlString (RWCSubString& ss);
      UtlString (float f);
      UtlString (UtlID id);
      UtlString (int i);
      UtlString (RWSize_T ic);
      UtlString (double d);
      UtlString (const UtlString& that)
      {
        this->operator =(that.data());
      }
      virtual ~UtlString();
      operator float () const;
      operator UtlID () const;
      operator int () const;
      float AsFloat () const;
      int AsInt () const;
      double AsDouble () const;
      troint64 AsLong () const;
      trouint64 AsULong () const;
      UtlString& operator << (const int value);
      UtlString& operator << (const troint64 value);
      UtlString& operator << (const float value);
      UtlString& operator << (const double value);
      UtlString& operator << (const char value);
      UtlString& operator << (const RWCString& value);
      UtlString& operator << (const short value);
      UtlString& operator << (const bool value);
      UtlString& operator << (const unsigned char value);
      UtlString& operator << (const unsigned short value);
      UtlString& operator << (const trouint64 value);
      UtlString& operator << (const char *value);
      UtlString& operator =  (const char *value)
      {
        this->remove(0,this->length());
        return *this;
      }
};

I am getting error in below code.

UtlString errMsg;

  errMsg = UtlString("DB Error: ")
    + UtlString(aStatus.message())
    + " ("
    + UtlString(aStatus.errorCode())
    + ") - "
    + UtlString((double)aStatus.vendorError1())
    + ": "
    + UtlString((double)aStatus.vendorError2())
    + ", "
    + UtlString(aStatus.vendorMessage1())
    + ": "
    + UtlString(aStatus.vendorMessage2());

Error: Overloading ambiguity between “UtlString::operator=(const char*)” and “UtlString::operator=(const UtlString&)”.

Can you please help me here in resolving this error. I don’t understand where UtlString::operator=(const UtlString&) is coming. I have never declared such operator.

Using CC: Sun C++ 5.8 compiler.

  • 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-02T12:54:45+00:00Added an answer on June 2, 2026 at 12:54 pm

    errMsg = UtlString... is an initialization, so the compiler feels free to take the copy constructor into consideration. That’s where you have your effective assignment operator UtlString::operator=(const UtlString&) from.

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

Sidebar

Related Questions

I have derived from a 3rd party class, and when I attempt to call
I have a derived derived class from an abstract class. The code is below.
I have a class derived from CTreeCtrl . In OnCreate() I replace the default
I have a some code that gets passed a class derived from a certain
Okay, so we have a utility here in-house that generates business-model classes from our
When you have a derived class, is there an simpler way to refer to
I have an AST derived from the ANTLR Parser Generator for Java. What I
I have a window (derived from JFrame) and I want to disable the close
We have application settings derived from ApplicationSettingsBase . When we push a new version
I need to find all the classes derived from System.Web.UI.Page which reference another class

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.