How use STL?

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
kapysh
New poster
Posts: 5
Joined: Wed Jul 19, 2006 10:13 am

How use STL?

Post by kapysh »

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.

sumankar
A great helper
Posts: 286
Joined: Tue Mar 25, 2003 8:36 am
Location: calcutta
Contact:

Post by sumankar »

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:

Code: Select all

#include <vector>
int main() 
{
   std::vector<int> vInt;
   // manipulate the vector   
}
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.

kapysh
New poster
Posts: 5
Joined: Wed Jul 19, 2006 10:13 am

Post by kapysh »

sorry, I don't list all topics

Post Reply

Return to “C++”