OK, I'm getting just this one error.
error C3861: 'upload_data': identifier not found
I have that function in the header file, why is it not seeing it? I can post code if needed.
3 21425
Yes, the identifier not found means the compiler does not know about upload_data.
Check that everything is spelled correctly and that you are including the header file.
If that fails, then post your header file and the line of code where the error occurs.
I have called other functions from the header file, so I'm not sure why it doesn't like this one.
HourlyEmployee. h - #include "Employee.h"
-
#include <iostream>
-
#include <fstream>
-
-
using namespace std;
-
-
#ifndef HOURLYEMPLOYEE_H
-
#define HOURLYEMPLOYEE_H
-
-
class HourlyEmployee:public Employee
-
{
-
private:
-
double hourly_wage;
-
double hours_worked;
-
string department_name;
-
public:
-
HourlyEmployee()
-
{
-
hourly_wage = 0;
-
hours_worked = 0;
-
department_name = "unknown";
-
}
-
-
HourlyEmployee(double hwage, double hworked, string dname, string first, string last, string ID) : Employee(first, last, ID)
-
{
-
set_hourly_wage(hwage);
-
set_hours_worked(hworked);
-
set_department_name(dname);
-
}
-
-
void set_hourly_wage(double hwage)
-
{
-
hourly_wage = hwage;
-
}
-
-
void set_hours_worked(double hworked)
-
{
-
hours_worked = hworked;
-
}
-
-
void set_department_name(string dname)
-
{
-
department_name = dname;
-
}
-
-
double set_hourly_wage()
-
{
-
return hourly_wage;
-
}
-
-
double set_hours_worked()
-
{
-
return hours_worked;
-
}
-
-
string set_department_name()
-
{
-
return department_name;
-
}
-
-
double compute_salary()
-
{
-
double pay;
-
pay = hourly_wage * hours_worked;
-
return pay;
-
}
-
-
void display()
-
{
-
Employee::display();
-
cout << "Department name: " << department_name << endl;
-
cout << "2 weeks salary: $" << compute_salary() << endl;
-
}
-
-
int upload_data(HourlyEmployee g[], int n)
-
{
-
int count = 0;
-
string first, last, id, dname;
-
double hworked, hwage;
-
-
ifstream infile;
-
while(!infile.eof() && count<n)
-
{
-
infile >> first >> last >> id >> hworked >> hwage >> dname;
-
g[count].set_firstName(first);
-
g[count].set_lastName(last);
-
g[count].set_employeeID(id);
-
g[count].set_hours_worked(hworked);
-
g[count].set_hourly_wage(hwage);
-
g[count].set_department_name(dname);
-
count++;
-
}
-
return count;
-
}
-
}
-
-
#endif
main.cpp - #include <iostream>
-
#include "StaffEmployee.h"
-
#include "HourlyEmployee.h"
-
#include <iomanip>
-
-
using namespace std;
-
-
#define SIZE 20
-
-
int main()
-
{
-
int count;
-
-
HourlyEmployee fellow;
-
fellow.display();
-
-
cout << "" << endl;
-
-
HourlyEmployee person(10, 55, "electronics", "Alan", "Good", "E1234");
-
person.display();
-
-
HourlyEmployee group[SIZE];
-
-
count = upload_data(group, SIZE);
-
-
return 0;
-
}
count = upload_data(gro up, SIZE);
upload_data is a member function. You can't just call it like this.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: IceColdFire |
last post by:
I have a VC++.net Win32 console application, however when I compile , I get
this error
error C2146: syntax error : missing ';' before identifier 'Length'
Explain...
Location pointed is
typedef struct _LIST
|
by: VicVic |
last post by:
Hello,
I have an old project, built with VC++. Now need to be compiled
in Visual Studio .Net 2003.
The project is going to build a DLL.
When i try to compile the project, i got the following errors:
c:\thepath\aaa.cpp(890): error C2065: 'm_nBackStyle' : undeclared identifier
c:\thepath\aaa.cpp(890): error C3861: 'm_nBackStyle': identifier not found,
even with argument-dependent lookup
|
by: Ben |
last post by:
Hi there,
We have a asp.net application working fine till a patch is applied to the
machine. Now it encounter error 404 page not found, although the page is
there.
Has anyone come across this before?
Thanks.
|
by: Tony Tone |
last post by:
I am having trouble resolving this issue:
Server Error in '/test' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
|
by: Hooyoo |
last post by:
I have included windows.h, but it still says
'InitializeCriticalSectionAndSpinCount': identifier not found. Why?
any ideas?
Thanks.
| |
by: P2P |
last post by:
Hi all,
I build my project on VS 2005 and get this error:
c:\dx90sdk\include\strmif.h(27392) : error C2146: syntax error : missing ';'
before identifier 'lpSurf'
can you help me how to fix this?
Thanks for any help.
|
by: zhang |
last post by:
error C3861: 'Navigate2': identifier not found
why???
|
by: FARAECHILIBRU |
last post by:
struct Node
{
int value;
int phoneNo;
string name;
string surname;
string adress;
string Email;
Node* pLeft;
|
by: Harshini Raj |
last post by:
Hi,
I am unable to fix this error. Canyou tell me what compiler options i have to use to fix this issue?
Issue Error 40:Undeclared identifier 'Name' -- Within an expression, an identifier was encountered that had not previously been declared and was not followed by a left parenthesis. Name is the name of the identifier.
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |