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?
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?
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.