Forum Discussion
Altera_Forum
Honored Contributor
18 years agoYour are on your way in the darkness down the wrong road. Its not possible to do what you describe here. (Strictly speaking this is not true, but don't even think of that now.)
Your target is some board with an FPGA, presumably an Altera dev kit. Your program will after compilation run on this board. This board has no way of accessing your files on your dev computer where your sources and testdata.dat are located. So outputdata.dat never get any data. Even if it had, you would not write to a file the way you describe, at least not if the language is C. And using the# include works but its likely not what you really intend to do. Every time you change the file you will have to recompile. Not practical at all. I suggest you put away the Nios IDE and fire up a C compiler which is targeting your pc. Grab a C book or some tutorial from the web and get acquainted with the language before starting to use the nios IDE dev environment. This environment is not suitable as a starter for C learning. But have in mind that although possible it is far from trivial and uncommon, to access files on your PC from the FPGA. Good luck