I don't want int to hold a string.
I want it to convert string to int automatically (without using Parse), when assigned...
User Profile
Collapse
-
-
It's clear. But instead of
int a = Int32.Parse("12 34");
I need to write only
int a = "1234";
Maybe the operator overriding could help... What do you think?Leave a comment:
-
Implicit conversion
Hello
I need the following code to work:
int a = "1234"
How can I modify the int type to accept string (or in ideal case to accept both string and int)???
Can I somehow modify it?
(I tried to inherite int to change its properties, but the compiler returns an error becouse of inheriting (I can't derive int)).
I would appreciate any help.
No activity results to display
Show More
Leave a comment: