References in C# are quite similar to those on C++, except that they are garbage collected.
Why is it then so difficult for the C# compiler to support the following:
Members functions marked const.
References to data types (other than string) marked const, through which only const member functions can be called ?
I believe it would...
In main:
char *myData[500][9]; //dynamic rows??
char **tableData[500]={NULL}; //dynamic rows??
int r;
newCallBack(db, &myData, &tableData, &r);
and passing into function by:
void newCallBack(sqlite3 *db, char** mdat, char*** tdat, int* r )
{
Doesn't seem to like this? Any suggestions? Lots of examples online when you don...
This question builds off of a previously asked question:
Pass by reference multidimensional array with known size
I have been trying to figure out how to get my functions to play nicely with 2d array references. A simplified version of my code is:
unsigned int ** initialize_BMP_array(int height, int width)
{
unsigned in...
I have the following code in my class :
sub new {
my $class = shift;
my %args = @_;
my $self = {};
bless( $self, $class );
if ( exists $args{callback} ) {
$self->{callback} = $args{callback};
}
if ( exists $args{dir} ) {
$self->{dir} = $args{dir};
}
return $self;
}
sub test {
my ...
In the question "Is returning a whole array from a Perl subroutine inefficient" two people recommend against optimizing if there is no need for it. As a general rule, optimizing can add complexity, and if it's not needed, simple is better. But in this specific case, returning an array versus an array ref, I don't see that there's any a...
Hello everyone,
Anything wrong with my code below? I got the compile error!
typedef unsigned char BYTE;
void foo(char* & p)
{
return;
}
int main()
{
BYTE * buffer;
// error C2664: 'foo' : cannot convert parameter 1 from 'char *' to 'char *&'
foo ((char*)buffer);
return 0;
}
Thanks in advance,
George
...
How do I suppress a MessageBox from showing that comes from a reference to an assembly that I do not own (nor have the code for)?
For example, my application (MyApplication.exe) is referencing an assembly coded by someone else (SomeoneElsesAssembly.dll). Inside of this assembly I'm calling a static method, which does what it's supposes...
I am looking for a good API documentation for Javascript especially related to browsers and DOM. I am not looking for any kind of Javascript tutorial, but simply a documentation for all standard Javascript classes and for classes used in web browsers.
Something similar to Java's Javadoc ( http://java.sun.com/j2se/1.4.2/docs/api/ )
...
I'm sending a subroutine a hash, and fetching it with my($arg_ref) = @_;
But what exactly is %$arg_ref? Is %$ dereferencing the hash?
...
We have a VB project that loads a reference to a .Net dll (which we also make). Both projects are being simultaneously developed.
When we add new classes to the referenced dll, the main project normally fails to notice the changes.
That is, if we added a new class Bar to the Foo dll, we should be able to type "Foo." and have Bar listed...
I am currently writing a Windows application in C# that will add documents to a document library list. I am trying to reference Microsoft.Sharepoint, however I do not see the COM or .NET library inside visual studio 2005 add references lists. What dll do I need to reference and where can I find this?
Thanks,
Alex
...
Could someone take the time to explain me the language underpinnings here :
int foo = myObject.SomeList.Count;
for (int i = 0 ; i < foo ; i++)
{
myObject.SomeList.Add(bar);
}
goes into an infinite loop because foo references a value that keeps being incremented. Modifying the first line to:
int foo = (int)myObject.SomeList.Count;
...
Here is a fake code sample
vector<Fred> gFred;
{
// init gFred
Fred &fred = gFred[0];
size_t z = 0;
do
{
fred = gFred[z];
// do odd processing with fred
z++;
}
while (fred.lastElementInSet == 0);
}
The thing that caught my attention was the fact that gFred[0] was being overwritte...
This is taken from Jon Skeet's excellent personal C# site (http://www.yoda.arachsys.com/csharp/):
StringBuilder first = new StringBuilder();
StringBuilder second = first;
first.Append ("hello");
first = null;
Console.WriteLine (second);
1) Changing the value of first will not change the value of second -
2) although while their valu...
Hi
I have installed an application that uses .net framework 3.5
after setup I can't find the exe file, when select properties it says it's a reference
How can I find it?
...
In a series of similar questions, what is the best AWK reference you've ever seen?
If there isn't really one (I've yet to find the grail), perhaps we could compile one in a separate question.
...
If, for example, you're going to write a variant type class, you will naturally need identification of what type an instance of that class is carrying. I'm wondering if anyone knows of any official or semi-official (de-facto?) reference of all primitive datatypes one would possibly be interested in?
Only primitives, and no need for abs...
Are these the same:
int foo(bar* p) {
return p->someInt();
}
and
int foo(bar& r) {
return r.someInt();
}
Ignore the null pointer potential. Are these two functions functionally identical no matter if someInt is virtual or if they are passed a bar or a subclass of bar?
Does this slice anything:
bar& ref = *ptr_to_bar;
-cory
...
I have a C# project that uses a dll. I added the dll to project references and I set the property Copy Local to False (I do not want to have local copies of that dll).
The compilation looks fine, but when I try to run the C# application, it cannot find the dll.
Where can I tell the project where to look for the library during runtime...
I know how to draw a button in C++ but how would i make an icon on it can someone post source or give reference please? by SendMessage() or if not that way just please paste
Please need easier anwsers without so many files im new a bit
...