I wrote a function along the lines of this:
void myFunc(myStruct *&out) {
out = new myStruct;
out->field1 = 1;
out->field2 = 2;
}
Now in a calling function, I might write something like this:
myStruct *data;
myFunc(data);
which will fill all the fields in data. If I omit the '&' in the declaration, this will not work. (...
So I want a pointer to a pointer.
I've got a class that is updated in one object. In another object I want a reference to the current version of the object in the original Class. Here is sort of a simplified version of what I have going on.
Public Class Foo
'conaints information
End Class
Public Class myMainApp
Dim myHelper ...
I was recently asked in an interview about the parameter for a copy constructor.
[Edited]
As a designer of C++ language implementing copy constructor feature, why would you choose constant reference parameter over a const pointer to a const object.
I had a few ideas like since a pointer can be assigned to NULL which probably doesn't m...
I want to know if there is any site like cpluplus.com which explains all the headers files and its available features, but for Linux ? Like for example explaining the sys/, net/, dns/* includes ?
I came up with this question because I was searching for a sys/reboot.h reference.
Any Ideas ?
...
How does the Visual studio populate the references tab?
By using something like currentDomain.GetAssemblies() or what?
...
Here I am thinking I know how to use lists in Perl, when this happens. If I do this (debugging code, prettiness not included):
#! /usr/bin/perl -w
use strict;
my $temp1 = "FOOBAR";
my $temp2 = "BARFOO!";
my @list = { $temp1, $temp2 };
print $temp1; #this works fine
print $list[0]; #this prints out HASH(0x100a2d018)
It looks like I...
Hi folks,
I've got a stock standard visual studio 2008 solution with 3 class library projects. Nothing in them - even the default class1.cs file has been deleted.
The first thing I do is open up the References then delete all of them except Core, System and System.Core.
I then add a new class, which creates Class1.cs.
Now, System.Dat...
(This question was lurking as an answer here)
What are the advantages of having projects in the same solution if you use file references?
In answers to this question about structuring large applications, several people mentioned having a 'monster' solution for the automated build (at least), and then developers each building their own ...
Good Day!!
I am creating an Outlook Automation App using Ms Access. My question is.. Is it possible to add references during runtime? How can this be done?
Thanks Guys
...
I am building a .Net solution using MSBuild v3.5 targeting .Net 2.0.
We are upgrading to use Crystal 11.5 so I have updated the binaries in our source control tree to contain the 11.5 version DLLs instead of the 10.0 DLLs.
In the project I reference some Crystal Reports DLLs. Here is a small example of the project file:
<Reference Inc...
I have several C# projects in one solution which reference some isolation-mode (regfree) COM DLLs. Some projects reference the same DLL, and when I build, I get error [MSB3180][1]: COM component 'SomeDll.dll' is defined in both 'Native.SomeProject.manifest' and 'Native.SomeOtherProject.manifest'".
The projects must reference the same CO...
When I read litb answer to this question, I learned that passing an array by reference allows us to obtain its size. I just played little bit with code, and tried to pass a "function" by reference and surprisingly (at least for me), this code compiles:
void execute( void (&func)() ) // func is passed by reference!
{
func();
}
Is t...
Hi,
[EDIT 1 - added third pointer syntax (Thanks Alex)]
Which method would you prefer for a DAL and why out of:
Car& DAL::loadCar(int id) {}
bool DAL::loadCar(int id, Car& car) {}
Car* DAL::loadCar(int id) {}
If unable to find the car first method returns null, second method returns false.
The second method would create a Car objec...
We are getting the error message noted in the subject line. It just started today.
Environment:
OS - WinXP SP3 with all the latest updates.
Visual Studio 2008 with all the latest updates.
Steps to recreate the problem:
Open Visual Studio and create a VB Class Library project. Add the following property and property method to Class...
Is it possible to assign an array variable to an array reference instead of to scalar variables?
Instead of this:
($a, $b) = some_sub(\@d, \@e);
I want something like this:
(@x, @y) = some_sub(\@x1, \@y1);
If so, how can I dereference it.where as in case of former, @$xxxx does for us.
Thanks.
...
When I do:
int x[] = new int[2];
System.out.println("...> " + x);
the output value is like this: [I@1b67f74
so that hex number is concerning to the memory address where the object has been allocated?
and [I what does it meaning?
...
Hi
I undersatnd that references are not pointers, but an alias to an object. However, I still don't understand what exactly this means to me as a programmer, i.e. what are references under the hood?
I think the best way to understand this would be to understand why it is I can't store a reference in a map.
I know I need to stop think...
I browse to a a dll and add it as a reference. The problem is the reference absolute path is being stored. How do I change this to be a relative reference instead?
...
I have been working with setting up TeamCity, and I have almost everything working with the exception of being able to compile VS2005 solutions that have referenced assemblies that are outside of the solution path. I have our SVN repository structured as follows
Root
Libraries
Project 1
Trunk
Pro...
Hi there,
I have quite a large project, actually 2 but they share a lot of projects between each other. The problem being when i compile from NOTHING i.e. no dll's in my common bin dir it fails..
This is due to the fact that some projects are not compiling before others that are dependent on them.
I have fixed it manually going throug...