C中的指针和文件 [英] Pointers and files in C
本文介绍了C中的指针和文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题解决了......我应该保留这个问题,但这是因为我没有这样做的学校项目。
Problem solved....I should kept the question but cause it's for a school project I didn't.
推荐答案
我有一些(未成年人) )错误 - 但我可能比你更严格地设置我的C编译器:它需要经典C,其中声明必须在函数中的任何代码之前 - 所以我必须移动i的声明
和my_array
到函数的开头。
之后,创建一个文件包含你的样本数据,运行正常,并创建了数组数据,这是我所期望的。数据是样本显示的 - 9个整数,从8开始,然后是52,91,......
那么有什么不同?
我在C only模式下用VS编译 - 我们在做什么不同?通过调试器运行时会发生什么?
I got a couple of (minor) errors - but I may have my C compiler set more strictly than you: it expects "classic" C, where declarations must precede any code in the function - so I had to move the declarations ofi
andmy_array
to the start of the function.
After that, and creating a file containing your sample data, it ran fine and created the array data, which is what I expected. And the data was what the sample showed - 9 integers, starting with "8", then "52", "91", ...
So what is different?
I'm compiling with VS on "C only" mode - what are we doing differently? What happens when you run this through the debugger?
这篇关于C中的指针和文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文