Questions tagged [addressof]

95 questions
0
votes
1 answer

Returning the address of a procedure to a variable

first at all sorry for my English, it's not my native language. I'd like to associate the address of a procedure that I created to a variable. Actually, I'm using a Windows Timer and in the Timer code, the function SetTimer is used this way : …
Chizu
  • 1
0
votes
2 answers

How to use address-of operator along with prefix increment on pointers in the same statement?

Is it possible to use address-of operator alongside prefix increment on pointers in the same statement, if yes how? Example, #include #include void main() { uint8_t arr_var[2]; arr_var[0] = 0xa; arr_var[1] = 0xf; …
tonyjosi
  • 717
  • 1
  • 9
  • 17
0
votes
1 answer

why ctypes.addressof() give diifferent result using python2 and python3

Recently I'm trying to transfer from python2 to python3,in my codes there is some job about read data form hardware that have a .py interface file call foreign .dll lib. The data is shared by memory between .dll and python routine,specifically…
loren
  • 1
0
votes
1 answer

Why passing by reference works using only pointers declared in the argument list of this C program?

This is Program 3.7 from Robert Wood's "C Programming for Scientists and Engineers". In the code below, the pointers are not declared and initialized in the body of main(), but directly in the argument list of read_data() function. Normally, when…
George
  • 37
  • 4
0
votes
1 answer

For a char d, I get strange output when executing cout << &d

i just started to learn c++, and I don't really understand, why when I cout &d, it shows up the char d as many times as i have showed it up already + add 1 time. So it shows 3 time the char "d" here... for the line cout << &d << endl; if someone can…
Kaj Half
  • 9
  • 3
0
votes
1 answer

When is the address of a const reference function parameter unique?

In my example code below, I'd like to know when two calls to log_cref_address will reliably print the same address. #include #include #include using namespace std; void log_cref_address(const int& t) { cout <<…
0
votes
1 answer

Reference to a non-shared member threading

I have opened a project built with VS2010 in VS2017. The code hasn't changed and the 2010 version built perfectly but when building with 2017 I get a 'Reference to a non-shared member requires an object reference' error with the following code. Dim…
RobertyBob
  • 803
  • 1
  • 8
  • 20
0
votes
1 answer

Sub not working after assigning addresses of cells where some data is found to variables

I have a strange problem. That code works as long as I don't assign addresses of cells to the variables komorka_k and komorka_y. Since 2 lines of the code marked with "LINE 1" and "LINE 2" are disabled, VBA macro works properly. What is the reason…
Paweł
  • 25
  • 7
0
votes
0 answers

Possible implementation of std::addressof

This could be a duplicate[link] but, the answer is rather short and not very clear. In a possible implementation like this: template T * addressof(T & v) { return reinterpret_cast(& const_cast(reinterpret_cast
user2338150
  • 479
  • 5
  • 14
0
votes
1 answer

What is the correct format for the address (&) and indirection operator

I've seen many different ways of writing the address-of operator (&) and the indirection operator (*) If I'm not mistaken it should be like this: //examples int var = 5; int *pVar = var; cout << var << endl; //this prints the value of var which is…
DConine
  • 9
  • 1
0
votes
3 answers

Pointer to the Address of Element of an Array

int s[4][2]= { {1234,56}, {1212,33}, {1434,80}, {1312,78} }; int i,j; for(i=0;i<=3;i++) { printf("\n"); for(j=0;j<=1;j++) { printf("%d ",*(s[i]+j)); …
0
votes
2 answers

Why is Taking the Address of a Function That is Declared Only Working?

I've asked a question here about whether taking the address of a function forces the compilation of said function specifically with regard to Substitution-Failure-Is-Not-An-Error. The most direct answer to this can be found here: Informally, an…
0
votes
1 answer

C++ copy constructor syntax: Is ampersand reference to r/l values?

The following is an excerpt from my C++ text, illustrating the syntax for declaring a class with a copy constructor. class Student { int no; char* grade; public: Student(); Student(int, const char*); Student(const…
bigcodeszzer
  • 916
  • 1
  • 8
  • 27
0
votes
1 answer

Dynamically created buttons don't fire routine

I have a gridview with a template column:
0
votes
1 answer

Can't get AddHandler and AddressOf to work with UpdatePanel

I am building a page that dynamically builds UpdatePanels, Panels, DDL, and Buttons. There is a single button for every UpdatePanel. I am doing some testing by trying to change a value after the button is clicked. As I step through the code after a…
Regis
  • 166
  • 4
  • 17