Using pointer can make my code faster?

1

I was told that if I work using pointers the program will be faster. If instead of using index to traverse a vector I use the pointer, does it get better?

    
asked by anonymous 30.07.2018 / 20:40

1 answer

4

No, this does not make sense because the index of a vector is a pointer. Of course there may be some situation that you do wrong and can make a difference, but it is circumstantial. See: Arrays are pointers? . In general it is less readable to use the pointer the array notation can be used.

    
30.07.2018 / 20:46