expected primary-expression before '*' and '->'

I dont know why i keep getting these errors
error: expected primary-expression before ‘*’ token
if (i==employee*->x())
^
error: expected primary-expression before ‘->’ token
if (i==employee*->x())
^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ifstream ifn("exception.txt");
 32 while(!ifn.eof() )
 33 {
 34 
 35 getline(ifn,i,'|');
 36 if(ifn.eof())
 37         break;
 38 getline(ifn,x);
 39 employee* e = new employee(n,atof(i.c_str()),atof(x.c_str()));
 40 char a = 'A';
 41 x.push_back(a);
 42 
 43 for(int i; i<x.size(); i++)
 44 {
 45 
 46 if (i==employee*->x())// where the problem is 
 47 
 48 w.add_exception();
 49         break;
 50 }
 51 }
 52 ifn.close();
 53 }
closed account (D80DSL3A)
Hard to tell for sure. Try if (i==e->x()) instead?
Also, provide initial value for i on line 13 (43) in for loop?
Last edited on
Didn't work I just got a
depot.cpp:46:11: error: ‘class employee’ has no member named ‘x’ error instead.
closed account (D80DSL3A)
Could you post your employee class definition? Apparently it doesn't define an x() method. Posting this may also help with resolving the problems in your other threads as well ( no employee(double, double) constructor ).
#include"depot.h"
7
8
9 depot::depot(int num)
10
11 {
12 employee* w(string n,int i,int g);
13 string i;
14 string n,g;
15 string x;
here it is.
Topic archived. No new replies allowed.