Questions tagged [addressof]

95 questions
-2
votes
3 answers

Error 1 Cannot implicitly convert type 'int**' to 'int*'. An explicit conversion exists (are you missing a cast?)

I'm learning C and C# and this question is for C#. I looking at pointers at msdn and this code is not compiling, it gives the error:Error 1 Cannot implicitly convert type int** to int*. An explicit conversion exists (are you missing a cast?).…
somethingSomething
  • 830
  • 7
  • 20
  • 43
-3
votes
1 answer

Why does pointer to array (done by &array) equal the array itself?

So I almost went all hurr durr on my classmates when they wrote that &array gives you address of the first element But turns out they are right. This sounds like inconsistency to me. We're talking about array defined like this: int numbers[] =…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
-3
votes
1 answer

Ansi C:Is an array's name Stored as a pointer variable?

Say, I define an array: int a[5]; And a = &a[0]; is an address to the beginning of the array. My question is, does a get stored someplace in memory like a pointer variable? If so, when I try to print the address of a (&a), why do I get the same…
-4
votes
2 answers

Why address(&) give random variable with array?

char a[] = {'A'}; printf(This is random value %c", &a[0] );
SK Singh
  • 1
  • 1
-6
votes
2 answers

address of operator and pointer operator

What is the difference between following two function definitions? Function declaration: void fun(int* p); Function Definition 1: void fun (int* p){ p += 1; } Function Definition 1: …
1 2 3 4 5 6
7