sir/madam
this is saikiran, i am learning c#lang .i come across a doubt that can we perform any operations between the value type and reference type variables?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 30, 2013, 1:14 AM EDT
However, what's actually happening here is that string concatenation operator is defined between either 2 strings or between a string and an object. In the latter case, the ToString() method is applied to the object and then that is concatenated with the string.
So, in the example, the following is (in effect) taking place:
object obj = 5;
string s = "Hello" + obj.ToString();
Console.WriteLine(s); // Hello5
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Sep 30, 2013, 1:14 AM EDT
saikiran3 reputationPosted Sep 30, 2013, 2:27 AM EDT
VulpesRank #55 · 29.2K reputationPosted Sep 30, 2013, 2:32 AM EDT
Can you either try to compress and upload it again or simply post the code.