I get an InvalidCastException with the following code:
Dim arr() As Integer = DirectCast(System.Array.CreateInstance(GetType(Integer), New Integer() {10}, New Integer() {1}), Integer())
As well as
Dim arr() As Integer = CType(System.Array.CreateInstance(GetType(Integer), New Integer() {10}...
Thanks... I thought BitArray was implemented using a Boolean(), but I was wrong. However, a little question: are the lower and upper bounds ALWAYS 0 and Length - 1, or can they be changed by constructing using non-zero lower bound arrays?
WHAAAT?!
I was writing my own BigInteger class which had an array of Booleans (not like the one in J# or Java), but that means that I'm using at least 8 times more memory than I thought!! Thanks a lot though!
Any ideas on how to improve performance?
Otherwise, my question has been answered. Thanks!
Does anyone know how to use the System.Buffer class with the Boolean data type? It makes no sense to set an element of a 1-bit data type using SetByte!!
Thanks.
Hi all...
I am trying to create something which allows me to calculate numbers to any precision (VB.NET/2005). I was wondering:
1. Whether I should make it a Class or a Structure
2. How to implement basic arithmetic operations (algorithms for Multiplication, Division, and Exponentiation of any...
I am creating a game (Tetris). Everything is going well, but I have a small problem:
Graphics (and the general coordinate system) takes an ordered pair (x, y) for the location, which is opposite to that of arrays (row, column), because row is actually y. How do I fix this problem? It wouldn't...
I'm not a pro, by here's my explanation (hope it helps):
How to you call another function without knowing its name? Just like you receive a variable ByRef without its name, you can do that with subs & functions. They are "safe" function pointers, or delegates.
If you want to create a delegate...
I wanted to know how to pass a read-only copy of an array, where neither the array nor the CONTENTS can be changed.
For example, if I say:
Dim t() as TextBox = New TextBox() {...}
and use the Array.AsReadOnly() to pass it as readonly, then all they nead to do is (assuming the passed array is...
How do you get notified whenever a process is started (not just by your application - by any program)? (For example, so you can change its priority immediately).
Thank you. I really appreciate it. And, you might want to know, C# is not much of a problem for me.
Just a note: this function is documented.
Also, I know about all that malicious code stuff, and I tell you (although you have absolutely no reason to believe me) that I am not doing anything...
Although I understand that you're trying to help me (thank you), I would really appreciate it if you answer the question rather than erase it. And remember what I said?
"However, I don't want problems with registry keys that have null characters in them"
You would have noticed that if that's what I wanted to do, I could have used RegOpenKey. However, I don't want problems with registry keys that have null characters in them (and no, I'm not trying to mess up my computer.)
How do you get notified when a variable's value is changed?
I can't use setter methods or properties, because I am passing a variable by reference (and have no access to the source code of that method).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.