15,914,594 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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