Click here to Skip to main content
15,901,035 members

Comments by EnjoY_Y (Top 3 by date)

EnjoY_Y 26-May-15 17:35pm View    
And, once again, thank you for help.
That second part of answer finished job.
EnjoY_Y 23-May-15 16:37pm View    
Don't get me wrong, of course that I'm not offended :)
I totally understand what u want to say, and it's important that we need to have clear situation about what we were talking about. Now when that is clear enough, I updated my question up there, with bunch of new informations so you can reread it.
EnjoY_Y 22-May-15 19:17pm View    
First of all, thank you for help, once more.

Now, when I say 'binary number' (decimal, or something third) I think it's clear that I mean 'number in binary representation' , it's logical and a little bit shorter. Maybe that have some third meaning in english, anyway you got what I mean.

About adding one, it's the same, of course. But I had different idea how to add it, and not to change number of digits, so then in next step I would not need to take it back again on same amount of digits(with zeros on their places, even on leading positions, because I needed them there). But that was bad idea.

But you gave my new, much better, idea about converting, and also about adding one. But second part of my question was not precise enough. My explanation was not so good. So now, I'll gave bigger picture of what I'm actually asking for

This is code line, which is giving me that '000' or '00' or something third and similar to that.


string b = rez.Substring(subnetmask, n);


It's a just small part of rez string, and now, when I cut it out, I need to start adding one(I have variable, 'n1' which is telling me how many times I need to add one).
So I'm taking that b to decimal


int b11 = System.Convert.ToInt32(b, 10);



And start to adding one, but every time when I add one, I need to convert that element back to binary, then to string with same amount of digits(like first element, which was b('000'...). Because after that, I need to take back
every single element to 'main' rez string. Now I know how I'm going to do this convert part. But...
*Question is, how I can work with every single element of that array(dynamic one), if I can even do it with arrays(multidimensional or something like that) or I need list in C#?

If I was precise enough, and you can get what I'm asking about. I'll post whole code, if something is not clear enough about variables which I mentioned, so you can take a look.
http://pastebin.com/mCb99yC7