我需要一些帮助链表。 我已经想出了如何做单独的链表,但是我在试图实现多个结构和列表时遇到困难。链表的帮助,单链接(多结构)(C编程)
我最后的程序都使用对于结构,但现在我必须实现链表的。 它说在函数中使用“外部指针”来遍历各种列表。
这是功课我的课之一,我不要求你所有为我做到这一点,但我要求帮我指出了正确的方向。
的结构如下:
struct stockItem
{
char stockName[60];
char stockType[60];
int itemNumber;
float actualCost;
float markUp;
int totalCurrentInventory;
int monthlyRestock;
float price; //stores actual cost + markup
};
struct roomData
{
float widthFeet, widthInch;
float lengthFeet, lengthInch;
char roomName[100];
int roomNumberOfType;
char roomType[6]; //char of room type
int roomStock[100][2]; //for storing each room stock types
int roomHasStock; //if the room has a stock avaliable
int roomStockCount; //how many stocks the room has
float area; // sq ft
float rentalRate;
float profitsPerRoom;
float netProfit;
float grossProfit;
char stockLine[200];
};
struct staffData
{
char firstName[100];
char lastName[100];
char fullName[100];
int employeeNumber;
char typeOfEmployee[10];
char payType[10];
float hourlyWage;
float salary;
int hours;
char address[150];
char city[150];
char state[10];
int zip;
char phone[30];
float yearlyTotalPay;
struct hireDate //holds staff hire date
{
int month;
int day;
int year;
}hireDate;
struct birthDate //holds staff birth date
{
int month;
int day;
int year;
}birthDate;
};
您将需要更具描述性。 “多结构和列表”是什么意思?什么是“外部指针”?你应该只发布作业的实际文本。 (除非那会让你陷入困境) – xaxxon
那么你在问如何在链表的节点中处理这些结构? –