Can I assign a pointer to an integer variable? Like the following.
int *pointer;
int array1[25];
int addressOfArray;
pointer = &array1[0];
addressOfArray = pointer;
Is it possible to do like this?
Not without an explicit cast, i.e.
addressOfArray = (int) pointer;
There's also this caveat:
6.3.2.3 Pointers
...
6 Any pointer type may be converted to an integer type. Except as previously specified, the result is implementation-defined. If the result cannot be represented in the integer type, the behavior is undefined. The result need not be in the range of values of any integer type.
So the result isn't guaranteed to be a meaningful integer value.