Pointer suggestions

Hello cplusplus community, I am now diving into pointers and I've got to say I'm enjoying myself a lot, I really enjoy coding and I've only really had issues with arrays other than that I'm finding myself very fluent in coding and I'm starting onto pointers now, it's a bit complex so I was just curious if you all could recommend to me small programs I could make to help me better myself with pointers so I can understand the syntax and not have to constantly refer to notes. Thanks guys you are all wonderful!
> it's a bit complex... so I can understand the syntax and not have to constantly refer to notes

Consider using type aliases liberally.
Then, you wouldn't have to remember arcane syntactical constructs or constantly refer to notes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using fn_type = int( double, long ) ;
using ptrfn_type = fn_type* ;

extern int foo( double, long ) ;
extern fn_type foo ; // same as above

fn_type* pf1 = &foo ;
ptrfn_type pf2 = pf1 ;

using array_type = int[6] ;
using ptr_array_type = array_type* ;

int a[6] ;
array_type b ;

ptr_array_type pa1 = &a ;
array_type* pa2 = &b ;
pa2 = pa1 ;
ptr_array_type pa3 = new int[34][6] ;
delete[] pa3 ;

using ref_const_array_type = const array_type& ;
ref_const_array_type cref = b ;
Topic archived. No new replies allowed.