Skip to main content

Questions tagged [pointers]

A pointer is a data type whose value refers directly to (or "points to") another value stored elsewhere in the computer memory using its address.

2 votes
3 answers
191 views

Say I have the following header #ifndef WINDOW_HPP #define WINDOW_HPP // includes... namespace window { struct Window { GLFWwindow *handle = nullptr; }; struct ...
user avatar
1 vote
1 answer
731 views

I'm writing my own dynamic programming language. So far I've been using a tagged union for all values. Since this boxes primitive types needlessly, I've begun researching tagged pointers which seem to ...
Matheus Moreira's user avatar
1 vote
7 answers
438 views

Most weakly typed languages do not have a concept of a pointer. Instead, most of them use references. However, is it possible to introduce pointers to such a language. From a naive point of view, to ...
Lily White's user avatar
1 vote
4 answers
856 views

I'm required to write the Low-Level Requirements of a Software Component which shall perform signal processing over arrays of 200k elements of integers/floats which lives in the main memory of the ...
Sam's user avatar
  • 31
0 votes
1 answer
86 views

I have the following code in C that reads data off a char array and makes decisions on what variables should some pointers point to. char preset1[20]; char preset1Name[20]; int preset1Temp; int ...
HFOrangefish's user avatar
0 votes
1 answer
130 views

I'm trying to make this function called walk in C. The idea is that the function takes as parameters a point in space (represented by an array), a function (pointer), and a step size / learning rate ...
Mehdi Charife's user avatar
4 votes
2 answers
2k views

When I started programming, I learned what Pointers are in C++. In Java, references are variables which hold the address of an object. So conceptually it's a pointer, without the ability to directly ...
tweekz's user avatar
  • 237
7 votes
1 answer
221 views

For example, which term completes the sentence "p has 5 ____" in order to describe a situation like int *****p?
vim_overlord's user avatar
0 votes
1 answer
428 views

As per Robert C. Martin in Clean Architecture, he gives a simple UML diagram to illustrate Dependency Inversion. To put it simply, HL1 initially referred to ML1 without interface to invoke F() ...
Andy Lin's user avatar
  • 185
-1 votes
5 answers
3k views

I happen to have a reason why I might want to dereference a nullptr. Of course when I do, my program crashes, and from what I gather, this is due to the compiler playing it safe and stopping my ...
Anon's user avatar
  • 3,649
1 vote
4 answers
12k views

I started to write a function which had a pointer to a vector as a parameter so that it could modify that vector to output results (as the actual return value was an error code), when I started to ...
I_like_robots's user avatar
2 votes
2 answers
322 views

I've created two separate binary tree classes, with some shared functions/variables and some that are not shared. So I have tried to abstract away the similarities in a base BinaryTree class. class ...
yomag1234's user avatar
0 votes
1 answer
137 views

Suppose I have a program.c that needs element_123 to do some operations, and element_123 can be accessed by including agent.h /*program.c*/ #include "agent.h" uint32_t element_123 = 0; ...
Andy Lin's user avatar
  • 185
2 votes
1 answer
3k views

I'm making a basic platformer game. I have a Game class as well as Level class. The game object holds a pointer to the current Level object. A level currently has a std::vector of GameObject raw ...
Luke B's user avatar
  • 147
11 votes
3 answers
3k views

I'm writing in C++, but this problem applies to any language without GC and even to languages with a GC as well. I have a structure in memory in which I create/add objects. The structure takes ...
Helloer's user avatar
  • 293

15 30 50 per page
1
2 3 4 5
10