传递结构数组的问题 [英] Problem passing an array of structs

查看:59
本文介绍了传递结构数组的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个使用结构数组的C程序,但是我在将数组作为参数传递时遇到了问题。结构是一个雇员,在头文件中定义为:

I am trying to write a C program that makes use of an array of structs, but I am having a problem passing the array as a parameter. The struct is an employee, defined in a header file as:

展开 | 选择 | Wrap | 行号

推荐答案

不要在函数头中使用const employee * empTable,而是尝试const employee empTable []?如果这不起作用,我不知道。
Instead of using const employee* empTable in the function header, try const employee empTable[]? If that doesn''t work, I dunno.


没有这样的运气......还有其他建议吗?
no such luck...any other suggestions?



没有这样的运气......还有其他建议吗?
no such luck...any other suggestions?



您使用的编译器是什么?


您的原始帖子中的代码使用Visual Studio编译和链接时没有错误。 NET 2005。

What compiler are you using??

Your code in your original post compiles and links without error using Visual Studio.NET 2005.


这篇关于传递结构数组的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆