c - 如何访问另一个结构内的链表的元素?
问题描述
我想计算 DriverProfile 链表中存在的元素数量。我想通过结构 ParkingLot 访问链表来做到这一点。
//Declaring the linked list
struct DriverProfile{
char name[20];
int license_plate;
struct DriverProfile *next_profile;
};
// Declaring the structure for parking lot containing the DriverProfile list identified by the *profiles pointer which is the pointer to the first element of the DriverProfile linked list
struct ParkingLot{
struct DriverProfile *profiles ;
int lotSize;
};
解决方案
推荐阅读
- laravel - Laravel Sanctum 返回 401
- python - 在BeautifulSoup抓取之后从Python列表中提取数据并创建Pandas表
- r - 预测锯齿中的新值(混合模型)
- r - 错误后在 R 中改进我的热图。(速查图)
- javascript - 在语义 UI 中的图像上添加文本
- unreal-engine4 - Hololens 2 + Unreal Packaging 仅在设备上失败
- git - 使用 Github 和 VS Code 检查之前的提交
- kubernetes - Istio 无法将请求路由到具有不同目标端口的工作负载
- amazon-web-services - 将 S3 存储桶从一个 AWS 账户复制到另一个 AWS 账户在传输过程中是否安全?
- azure - 每小时对 API 进行 REST 调用并将结果保存到 Azure SQL