defining 1D and 2D vectors and sending floats to them

How can i define a 1D and 2D vector and then send them floats?
1D vector

std::vector<float> v;

2D vector

std::vector<std::vector<float>> v;

std::vector<std::vector<float>> v;

if you are not using c++11, you must add space between two >s
std::vector<std::vector<float> > v;
thanks a lot but what is inside of these vectors now?
in my code inputs are read from a file to a float variable, say y. I want to send this y to vector.
the text file is a table consisting of 5 columns and 75 rows.
when i want to work with these floats how will i call them?
std::vector<std::vector<float>> v( 75, 5 );
Last edited on
one last question: how can i send inputs to it and print them?
use at() function or simply do this with []s as like arrays.
Topic archived. No new replies allowed.