写入/读取文件时的结构和功能 [英] Structures and functions when writing/reading to file

查看:65
本文介绍了写入/读取文件时的结构和功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从main调用函数时,我很难定义函数原型和相应的参数。非常感谢任何帮助。

展开 | 选择 | Wrap | 行号

解决方案

我认为你最大的困难可能是你试图通过各种功能传递OpAmps。 (而你似乎至少缺少一个})


如果你只有这些结构中的一个(你想要一个全局(ish)结构,你可以制作一个静态结构,你不需要把它传递到任何地方。


否则,你可以创建一个struct的实例,但是你需要传递一个变量命名方法


例如:

展开 | 选择 | Wrap < span class =codeDivider> | 行号


谢谢你,当我调试代码我的主要错误是将结构传递给Save,Loa d和显示功能,我得到错误,无法将参数1从OpAmps [10]转换为''OpAmps''我该怎么纠正这个?


你是否已经实现了Save Handy的ypour实现?

I am having difficulty defining the function prototypes and corresponding parameters when the function is called from main. Any help is greatly appreciated.

Expand|Select|Wrap|Line Numbers

解决方案

I think your greatest difficulty may be that you are trying to pass OpAmps through various functions. (and you seem to be missing at least one })

If you have only one of these structs (that is you want a "global(ish)" struct, you can make a static struct, and you don''t need to pass it anywhere.

Otherwise, you can create an instance of the struct, but then you would need to be passing a variable name through to the methods

eg:

Expand|Select|Wrap|Line Numbers


Thankyou, when i debug the code my main error is when passing the struct into the Save, Load and Display functions, i get the error, cannot convert parameter 1 from OpAmps[10] to ''OpAmps'' how would i correct this?


Have yougpt ypour implementation of Save Handy?


这篇关于写入/读取文件时的结构和功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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