no match to call

I'm having an error when I'm creating an object "as no match to call"
My method is:

1
2
3
4
5
void CPoiDatabase::addPoi(t_poi type, string name, string description, double lat, double lon)
{
	m_POI[m_noPoi](type, name, description, lat, lon);
	m_noPoi++;
}


my header file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Generated by Together */

#ifndef CPOIDATABASE_H
#define CPOIDATABASE_H
#include "CPOI.h"

class CPoiDatabase
{
	CPOI m_POI[10];
	int m_noPoi;
public:
	CPoiDatabase();
	void addPoi(t_poi, string, string, double, double);
	CPOI* getPointerToPoi(string name);
};
#endif //CPOIDATABASE_H 


also I have defined a constructor for CPOI

I really cannot understand where the error is.
What does the expression

m_POI[m_noPoi](type, name, description, lat, lon);

mean?!

This expression can be valid in two cases. Either m_POI[m_noPoi] is a function pointer or m_POI[m_noPoi] is an object of a class that defined a corresponding operator function.
Last edited on
first im sorry if this might be really stupid but i have been programming full day to complete this assignment and my head is going crazy!
anyway what i'm trying to do is add the values received by the addPoi method into the object m_POI. if the function is called four times then there should be 4 set of values at m_POI[0],m_POI[1],m_POI[2] and m_POI[4].
could please help me how can i achieve this?
If I understand correctly, you want to store into m_POI[m_noPoi] the object of class CPOI created from the arguments (type, name, description, lat, lon) ?

In that case, this should work:
 
m_POI[m_noPoi] = CPOI(type, name, description, lat, lon);

Topic archived. No new replies allowed.