1. ## pointer intializing to

run this code OK. How do I modify it so I don't have to use the t veriable.

Code:
```int mat[N][N]={{2,4,6,8},{24,8,3,10},{22,1,8,12},20,18,16,14}};
int t, *d;
t=mat[0][1]-mat[0][0];
d=&t;```

2. Originally Posted by ronenk
run this code OK. How do I modify it so I don't have to use the t veriable.

Code:
```int mat[N][N]={{2,4,6,8},{24,8,3,10},{22,1,8,12},20,18,16,14}};
int t, *d;
t=mat[0][1]-mat[0][0];
d=&t;```
You want the address of a variable, but you don't want this variable? Impossible. Be more specific.

3. You can't. t is an integer, which is storing the result of two integers being subtracted. Thus, it give you an integer. If you want a pointer to an integer, you have to have at least one integer to point to. What your code does, in effect is this:
Code:
```int t, *d;
t = 4 - 2; /* make t store something, doesn't matter what */
d = &t; /* make d point to t */```
You have to have an integer for your pointer to point at. In short, all pointers must have something to point at.

Curses, foiled again.[/edit]

Quzah.

4. to make myself clearer: what I wanted was somthing like this:
Code:
```int mat[N][N]={{2,4,6,8},{24,8,3,10},{22,1,8,12},20,18,16,14}};
int  *d;
d=mat[0][1]-mat[0][0];```
what might replace this type of thing? is there?

5. How about instead of saying what you want with really bad code, you say what you want to do in words.

6. mabey
Code:
```int *d;
d = malloc(sizeof(int));
*d  = 4 - 2; /* :) */```

7. >>mat[0][1]-mat[0][0];
That evaluates to an r-value, or basically _a number_, meaning it isn't stored at any particular memory location that you can point at with a pointer. It's like saying:

int* d = &2;

The only solution I can see is something along the lines of what chrismiceli posted, although that is messier and harder to use than the method involving the 'int t;'. In fact, it does pretty much the same thing, except that the variable is allocated on the heap instead of the stack, and d points to the heap-variable which you then have to free() after you're done with it.

8. Thank you.
BTW: why can't I find your website? is it down or is it my side problem?
After a long time of hanging I get "Gateway Timeout".

9. It seems to be down That happens once in a while (very annoying), but it usually goes back up in a day or two. Sorry!