I am using Dev C++ however getting errors when I call MinIndev method from a vector. - #include <vector>
-
-
using namespace std;
-
-
int main ()
-
-
{
-
-
vector<double> parameter_range(4, 2.0);
-
vector<double> result (parameter_range.size(), parameter_range.MinIndex());
-
-
}
So here I do not get an error when I use size(). However, I get ".......... has no member named MinIndex" error. I would appreciate any insight.
Emre
5 2436 JosAH 11,448
Recognized Expert MVP
Have a look at the vector class documentation. The compiler is right:
there is no such member function. Who or what gave you the idea that there
was such a function?
kind regards,
Jos
AdrianH 1,251
Recognized Expert Top Contributor
I am using Dev C++ however getting errors when I call MinIndev method from a vector. - #include <vector>
-
-
using namespace std;
-
-
int main ()
-
-
{
-
-
vector<double> parameter_range(4, 2.0);
-
vector<double> result (parameter_range.size(), parameter_range.MinIndex());
-
-
}
So here I do not get an error when I use size(). However, I get ".......... has no member named MinIndex" error. I would appreciate any insight.
Emre
Perhaps you wanted to use the algorithm min_element()? The result is kinda obvious though. 2.0.
Adrian
OK, thanks for the clarification. It seems that the code I have borrowed is not using the standard vector class. I guess this MinIndex function only works for some special compilers.
JosAH 11,448
Recognized Expert MVP
OK, thanks for the clarification. It seems that the code I have borrowed is not using the standard vector class. I guess this MinIndex function only works for some special compilers.
No, it's not the compiler (at least I hope not), it's the definition of the class
template. Better stick to the STL and don't use any proprietary libs that don't
supply any decent documentation.
kind regards,
Jos
AdrianH 1,251
Recognized Expert Top Contributor
One way to determine if it is a STL function/class is that STL doesn't use camel case, it has underscores ('_') between words.
Adrian
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Kitty |
last post by:
Hi, everyone.
Given a vector<int>, what is the fastest way to find out whether there is a
repeated element in it? The result is just "true" or "false". Thanks.
Kitty
|
by: Hamish |
last post by:
I havea program which on execution gives unpredictable behaviour (it
shouldn't). In trying to track down the problem, I'm wondering if there is a
difference between these two ways of filling a std::vector with data:
Method 1:
std::vector<int> v;
int k;
for(i=0;i<n;i++){
|
by: Martin S. |
last post by:
the class:
public __gc class Vector {
private:
Double y, x, z;
public:
Vector() {
y(0),
|
by: shuisheng |
last post by:
Dear All,
I have a question. Assume
#include <vector>
using namespace std;
class A
{
private:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |