Hey guys I keep encountering a memory fault trying to call a class member function. Does anyone know why? Am I accessing something I shouldn't be? Thanks.
Need to see more of your code to know what's going on. Specifically, what are the values of size, capacity, and front for deque1 when entering the loop. Also your class definition (just the header file will do).
Not related to your current problem, but consider the case of calling insert_front when
front == 0
size == capacity
capacity >= 2
From arr[size - 1] to arr[front - 1] will be garbage values. Not sure if that's what you want.