error in this line when create vector program in cpp program and how to resolve in dev cpp editor
vector<int> v={12,24,56,45,32,76};
error in this line when create vector program in cpp program and how to resolve in dev cpp editor
vector<int> v={12,24,56,45,32,76};
You can create a an array first that you then use with the vector
constructor that takes iterators.
Example:
#include <vector>
template<typename T, size_t N>
size_t size(const T(&)[N]) {
return N;
}
int main() {
int arr[] = {12,24,56,45,32,76};
std::vector<int> v(arr, arr+size(arr));
}
I also got this Issue & has been fixed.
In Devc++ ,
Go to
Tool > Compiler Options > Settings > Code Generation
& Set "Language Standard" to "ISO C++11"
No need any other changes.See this