Guys, it's me again, the newbie, I just started working with vectors and kind of have no idea how to deal with them :@
I need to create a vector which has n members and the member is the negative number of it's index. For example the 1st step at the console should be to type a value for n=
then for example if n=5, the vector will have five members, A{5}= {-1, -2, -3, -4, ,5}
so the members will always start from 1 and go up to n but since we want them to be negative, we want them to start from -1
or like it is written in my book ai= -i
(where "i" is the index...)
please help me :(
Anyway what's with the #include <fstream> ? I removed it and nothing happened, is it unnecessary there? The compilation went normal
the same with <strings> and <vectors>
although when I removed #include <vectors> there are some changes at the compilation, it tells me that the vector is undeclared identifier, but when i execute it, it gives me the same result with the numbers...
i started learning c++ because of school, but now im in love with it :v , and i know that in the future i'm going to need it (im going to study automatics at university) , so i have this need to question everything
please give me some explanations why did you use fstream, string and vector?