ptr_array_type aliases int (*)[3], not int * - you will not be able to use it to iterate through array_type. You could use it to iterate through an array of array_type, like so:
array_type arr[3];
ptr_array_type ptr = arr;
while ( size_t i = 0; i < 3; i++ )
do_something_with( ptr[i] );
If you want to be able to iterate through an array of T with a pointer, then the type of that pointer must be T *. So you'd need to change your typedefs to something like
typedef int array_type[3]; // probably want to replace int with another
typedef int *ptr_array_type; // typedef to abstract out the type
...
array_type a = {1, 2, 3}; // yuck! don't do this! a is not obviously an array,
// so an array initializer looks wrong in this context
ptr_my_type p = a;
printf( "%d", *p );
However...
If you're using typedef to abstract away implementation details for a type, then you should abstract away all implementation details for that type, including things like dereferencing and subscripting. You'll want to create a full API, such as:
array_type *arr = new_array_type( 1, 2, 3 ); // even this is leaky since it assumes we know
// the array element type is integral
array_type_iterator *itr = new_array_type_iterator( arr );
array_element_type target;
begin_iterator( &itr );
while( next_iterator( &itr ) )
{
get_data_from_iterator( itr, &target );
write_array_element_to( stdout, target );
}
free_array_type_iterator( itr );
free_array_type( arr );
Partial or leaky abstractions just lead to code that's confusing to use and maintain. If the user of a type has to be aware of that type's "array-ness" or "pointer-ness" in order to use it properly, then don't hide those qualities behind a typedef without providing replacements for the [] and unary * operators as well. Also provide some way to abstract out I/O - don't force the user to have to know whether to use %d or %f or %s in a printf statement if they're not working with a primitive type.
TtoT*variable. These are incompatible. And the factTis array does not change it.*ptrisint[3]. This decays to a pointer to the first element, which is not at all equivalent to the value of the first element.