S
sandeep
When we use STL which memory space it will use whither it is stack or
heap or data segment
How to make STL to create in heap?
How to make whole container to create in heap?
I think container uses stack is it correct ?
I am using double linked list so in place of it I want to use STL for
#include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
void fun();
void fun1();
vector<int> root;// I want to create this in heap
void main()
{
fun();
fun1();
}
void fun1()
{
printf("%d\n",root[1]);
}
void fun()
{
root.push_back(55);
root.push_back(66);
heap or data segment
How to make STL to create in heap?
How to make whole container to create in heap?
I think container uses stack is it correct ?
I am using double linked list so in place of it I want to use STL for
#include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
void fun();
void fun1();
vector<int> root;// I want to create this in heap
void main()
{
fun();
fun1();
}
void fun1()
{
printf("%d\n",root[1]);
}
void fun()
{
root.push_back(55);
root.push_back(66);