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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:58:41+00:00 2026-05-15T08:58:41+00:00

int value = 5; // this type of assignment is called an explicit assignment

  • 0
int value = 5; // this type of assignment is called an explicit assignment
int value(5); // this type of assignment is called an implicit assignment

What is the difference between those, if any, and in what cases do explicit and implicit assignment differ and how?


http://weblogs.asp.net/kennykerr/archive/2004/08/31/Explicit-Constructors.aspx

EDIT: I actually just found this article, which makes the whole thing a lot clearer… and it brings up another question, should you (in general) mark constructors taking a single parameter of a primitive type – numeric/bool/string – as explicit and leave the rest as they are (of course keeping watch for gotchas such as constructors like (int, SomeType = SomeType())?

  • 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-15T08:58:41+00:00Added an answer on May 15, 2026 at 8:58 am

    They differ if a class has a constructor marked ‘explicit’. Then, one of these does not work.

    Otherwise, no difference.

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

Sidebar

Related Questions

I'm using int as an example, but this applies to any value type in
Given this class: class C { private: struct Foo { int key1, key2, value;
I have this warning warning: assignment from incompatible pointer type in this line: data1->transformed_block[l]
This works: int valueAsInt = 0; if (Int32.TryParse(value, out valueAsInt)) { record.GetType().GetProperty(property).SetValue(record, valueAsInt, null);
I have this custom type: public struct PasswordString { private string value; public PasswordString(string
With regards this example from Code Complete: Comparison Compare(int value1, int value2) { if
Simple. If I use: public void Add(params int[] values) Then I can use this
I have variable @count of datatype int.I am setting values to this @count. I
How can I get the int value from a string such as 423e -
Having code: struct B { int* a; B(int value):a(new int(value)) { } B():a(nullptr){} B(const

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.