Questions tagged [indirection]

Any of various programming concepts related to the level of abstraction applied to a particular problem, algorithm or scenario. Examples may include substituting higher-level programming constructs where previously lower-level constructs were previously applied.

Indirection

Any of various programming concepts related to the level of abstraction applied to a particular problem, circumstance, algorithm or knowledge domain.

160 questions
0
votes
1 answer

What is the typical level of indirection between a controller and a view in mvc and similar architectures?

So say I make a controller for a main menu 'page', would MainMenu be composed of the individual view elements like labels and buttons directly or would it reference a class such as MainMenuView which had those elements instead? Or would it just send…
fordeka
  • 979
  • 2
  • 7
  • 22
0
votes
2 answers

Can you perform code indirection in .NET?

I remember with InterSystems Cache code, you can use indirection to take a string and turn that into real executable code by preceding the string variable with "@". Can this be done in C#.NET or VB.NET code? So I'd like to have a method that would…
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245
-1
votes
7 answers

C Array versus Named Variables

If this is a pointer to the first element of the array: int foo[5]; Then isn't it more efficient to label each of the individual members: int foo0, foo1, foo2, foo3, foo4; The first one looks neater, but is it using indirection because the variable…
Alasdair
  • 13,348
  • 18
  • 82
  • 138
-1
votes
1 answer

how do i initialize a pointer with 3 levels of indirection? c++

shaded boxes are pointers and elements that hold the values are on the heap diagram I pretty much need to come up with the statements to implement the diagram. I am so thrown off by initializing something pointed to with 3 levels of indirection that…
-1
votes
4 answers

Weird Pointer issue in C++

I'm running into a VERY frustrating pointer issue. I previously posted here: TOUGH: Dealing with deeply nested pointers in C++ But that post got overly long and is stale, so I chose to repost with more details. Here is my header file that defines…
-1
votes
1 answer

Handling a function call nested within multiple levels of conditionals

Basically, I want to show something if multiple levels of conditions are satisfied. I'm curious about performance and maintainability of 3 different approaches. : // Approach 1 if (condition_1) { // do_stuff_1 ; if (condition_2) { //…
mnemotronic
  • 856
  • 1
  • 9
  • 16
-2
votes
3 answers

C++ return another class object

Yes I know it sounds weird, but I'm looking for a way to overwrite the indirection operator to return another class object. Let me explain better: In main.cpp I got MyInt *V = new MyInt[10]; (*V)[3]=10; but I would like to have it like: MyInt *V =…
Opaco
  • 3
  • 2
-2
votes
1 answer

Android How to pass value in this asynctask?

how to pass a Value from edittext to this asynctask (do in background)? public class connectTask extends AsyncTask { @Override protected TCPClient doInBackground(String... message) { mTcpClient = new…
-2
votes
1 answer

I am getting error in this code as "invalid indirection"

I am trying to dynamically allocate a contiguous block of memory, store some integer value and display it. #include #include void main() { int i; int *ptr; ptr=(void *)malloc(sizeof(int)*5); //allocation of memory …
-2
votes
4 answers

Declaring C Pointers - Why do we use * and not &

My question is a simple one (I hope) about c syntax regarding pointer declaration. I am fully aware of how to declare a pointer, how its used and what the effects are, like as follows. int *val_ptr; int val =99; val_ptr = &val; However, what…
Andrew S
  • 2,847
  • 3
  • 33
  • 50
1 2 3
10
11