reference Questions

3

There are three ways to pass an array to a function 1. void changeArray(int array[]) { array[0] = 1111; } void changeArrayByPointer(int * array) { array[0] = 1111; } void changeArray(int ...
Watkins asked 20/8 at 4:14

4

Solved

Consider the following example from the Book: fn main() { let string1 = String::from("abcd"); let string2 = "xyz"; let result = longest(string1.as_str(), string2); println!...
Discrepant asked 2/6, 2021 at 9:32

1

tldr;> Given a trait function that takes a generic callback argument which returns an associated type, the compiler complains that the associated type may borrow arguments from the callback func...
Quadrangular asked 14/8, 2023 at 1:25

6

Solved

In the code: y = 7 x = y x = 8 Now, y will be 7 and x will be 8. But actually I wan to change y. Can I assign the reference of y and do that? For example, in C++ the same thing can be achieved as:...
Spare asked 27/6, 2012 at 8:43

4

Solved

My view is having issues finding a class located in one of my references. This reference is to a dll built outside of the project. The view always gives error: The type or namespace name 'Compa...
Skiascope asked 7/3, 2011 at 17:54

6

I have a problem with understanding the "pass-by-value" action of Java in the following example: public class Numbers { static int[] s_ccc = {7}; static int[] t_ccc = {7}; public static void ...
Ornas asked 31/1, 2009 at 12:33

1

Solved

Here is the code: #include <vector> #include <functional> class TestClass { public: const std::vector<int> &getStuff() const { return callback(); } protected: std:...
Redound asked 20/6 at 12:32

4

Solved

I have been searching for a way to save the references of variables of various types into a dictionary, together with a corresponding key. Then i would like to modify the instance of the variable b...
Macarthur asked 20/6, 2014 at 13:57

3

Solved

Question What is the best way to set a JSONField to have the default value of a new list in django? Context There is a model where one of the fields is a list of items. In the case where there a...
Tidbit asked 15/2, 2017 at 2:47

3

Solved

I am trying to use the newtype pattern to wrap a pre-existing type. That inner type has a modify method which lets us work with a borrowed mutable value in a callback: struct Val; struct Inner(Va...
Genaro asked 1/1, 2019 at 22:59

3

Solved

I am using AutoMapper to convert a UI model to POCOs that I later serialize to XML using a DataContractSerializer in order to preserve the references between them. The problem comes that, when map...
Strow asked 21/5, 2013 at 9:27

4

Solved

Given to functions void main() and void hello(byte* a[4]). Main function has an array of four bytes. The array's reference needs to be passed to the function hello for manipulation. I would expect ...
Pronty asked 20/7, 2017 at 17:2

6

Solved

I understand the concept of references in C++, and I understand what they do when used in function parameters, but I am still very much confused on how they work with return types. For example, wh...
Bouse asked 5/12, 2012 at 7:42

14

Solved

I've got a massive Excel 2003 spreadsheet I'm working on. There are a lot of very large formulas with a lot of cell references. Here's a simple example. ='Sheet'!AC69+'Sheet'!AC52+'Sheet'!AC53)*$D...
Macneil asked 12/7, 2011 at 17:25

9

Basically, I want to do some preventative maintenance. There are certain third-party libraries that I'd like to prevent being included as references in a certain project. Is there a way you can spe...
Single asked 21/6, 2013 at 1:20

4

Solved

I am trying to understand how references and Box<T> work. Let's consider a code example: fn main() { let x = 5; let y = &x; assert_eq!(5, x); assert_eq!(5, *y); } In my imagination,...
Trench asked 24/1, 2020 at 13:33

10

I am faced with a problem that gives me this error: A circular reference has been detected when serializing the object of class "App\Entity\User" (configured limit: 1) I have an Enterpr...
Concede asked 10/12, 2019 at 13:34

3

Solved

I am using Visual Studio Community 2019 to write a new serial port downloader program. I am relatively new to C# but have had to maintain a large-ish c# application that also uses the serial port t...
Spectroheliograph asked 8/8, 2022 at 16:33

5

Solved

Is it possible in Google Spreadsheets to reach the value of the cell just above? Meaning: In one cell A2 I want to display the value from the cell above, that is A1. Not because it is that coordin...
Artimas asked 3/10, 2014 at 12:10

2

Solved

I know that void& is invalid. But, are there any other types, that are non-referenceable?
Unijugate asked 17/12, 2019 at 3:45

3

Solved

Quote from ( Safe in C# not in C++, simple return of pointer / reference, answer 3) by Eric lippert. Also, note that it is not any reference to the Person object that keeps it alive. The referen...
Mag asked 10/12, 2011 at 18:32

10

Solved

vector<int> v; v.push_back(1); v.push_back(v[0]); If the second push_back causes a reallocation, the reference to the first integer in the vector will no longer be valid. So this isn't safe...
Erbium asked 13/9, 2013 at 14:27

9

Solved

I'm getting the following exception when trying to call GetDatabase method of the MongoClient class after adding a new configuration using VS config. manager: Could not load file or assembly 'Syste...
Phio asked 21/7, 2020 at 16:41

8

In my component I have declared some data: data() { return { defaultValue: {json object with some structure}, activeValue: {} ... And within the component I assign defaultValue to activeValue:...
Jigsaw asked 11/7, 2020 at 10:13

3

Solved

I am passing some weakrefs from Python into C++ class, but C++ destructors are actively trying to access the ref when the real object is already dead, obviously it crashes... Is there any Python C...
Competent asked 7/6, 2010 at 21:43

© 2022 - 2024 — McMap. All rights reserved.