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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:41:07+00:00 2026-05-13T14:41:07+00:00

typecast operator is cool in c++, no such thing in c#? c++ code: class

  • 0

typecast operator is cool in c++, no such thing in c#?

c++ code:

class A
{
int dat;

public:
A(int num = 0 ) : dat(num) {}

operator int() {return dat;} // cast to int
};
  • 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-13T14:41:08+00:00Added an answer on May 13, 2026 at 2:41 pm

    C# has! here couple examples from MSDN:
    Explicit:

    public static explicit operator Celsius(Farenheit f)
    {
        return new Celsius((5.0f/9.0f)*(f.degrees-32));
    }
    

    Implicit:

    //  User-defined conversion from double to Digit
    public static implicit operator Digit(double d)
    {
        return new Digit(d);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There are 2 options I'm aware of which control the… May 16, 2026 at 12:34 pm
  • Editorial Team
    Editorial Team added an answer Hi Kent if you look at the exports there are… May 16, 2026 at 12:34 pm
  • Editorial Team
    Editorial Team added an answer If you want more control over what to render, rather… May 16, 2026 at 12:34 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Possible Duplicate: Conditional operator cannot cast implicitly? I have run into a peculiar situation
-Edit- Alternative question/example How do i cast A to object to class A when
Basically i want to do this. aa causes a bad cast exception. NOTE: o
Today I faced a strange problem in C#. I have an ASP.NET page where
For a system I need to convert a pointer to a long then the
When working with arrays and pointers in C, one quickly discovers that they are
I know it is possible to assign an unsigned char to an unsigned short,
I have a question concerning floating constants in C. In Java, the default type
I am trying to create my own std::string wrapper to extend its functionality. But
I would like to provide a templated function, that varies its implementation (->specialization) according

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.