Sorry for stupid question, but i donn't understand how rightly use STL in my c++ programs.
I wrote this:
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
int N,i,j,k,l,max;
vector<int> mas[40004];
...
and if says "Compilation Error".
Please help.
How use STL?
Moderator: Board moderators
0. Post in the right place. [Help On Languages -> C++]
1. What are you trying to do? Your code is declaring/defining an array of vectors (roughly a 2D array) of integers. Is that what you want? Or, is it that you want a 1D array in which case the following suffices:
2. Use <cmath> instead of <math.h> if you want C math library functions.
3. Post the whole code: its not possible for us to deduce where and why you are hitting a CE.
1. What are you trying to do? Your code is declaring/defining an array of vectors (roughly a 2D array) of integers. Is that what you want? Or, is it that you want a 1D array in which case the following suffices:
Code: Select all
#include <vector>
int main()
{
std::vector<int> vInt;
// manipulate the vector
}
3. Post the whole code: its not possible for us to deduce where and why you are hitting a CE.