online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> template<class type, std::size_t capacaty> class StaticVector { private: type arr[capacaty]; std::size_t m_size; public: StaticVector() : m_size(0) {} type at(std::size_t index) { if (index >=0 && index < m_size) { return arr[index]; } return type(); } void remove(std::size_t index) { if (index >=0 && index < m_size) { for (std::size_t i=index; i < m_size-1; i++) { arr[i] = arr[i+1]; } m_size--; } } void push_back(type val) { if (m_size < capacaty) { arr[m_size] = val; m_size++; } } std::size_t size() { return m_size; } }; int main() { StaticVector<int,5> sv; sv.push_back(1); sv.push_back(2); sv.push_back(3); sv.push_back(4); sv.push_back(5); for (int i = 0; i < sv.size(); i++) { std::cout << sv.at(i) << " "; } std::cout << std::endl; sv.remove(3); for (int i = 0; i < sv.size(); i++) { std::cout << sv.at(i) << " "; } std::cout << std::endl; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue