Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@arpytoth
arpytoth / pointer_to_vector.cpp
Created November 24, 2015 18:37
The dangerous pointer to vector
#include <iostream>
#include <vector>
int main()
{
std::vector<int> intVector;
intVector.push_back(1);
// We get the pointer to the first element from our vector.
int* pointerToInt = &intVector[0];