Shucks, I was hoping for a good...never mind. :p :p
You're welcome.
Type: Posts; User: Adak
Shucks, I was hoping for a good...never mind. :p :p
You're welcome.
You need to add the & before any non-string variable that you scan in (unless it's a pointer already).
for(i=0;i<n;i++)
{
fgets(s[i].name, sizeof(s[i].name), f);
fscanf(f,"%d %f %f ...
Everywhere you declare a Stock struct in your program, you need to have:
struct Stock nameofStockInstance;
The keyword "struct" is essential, and your compiler should be giving you multiple...
I have Pelles C, and Pelles C is for C only and Windows only.
Please, before we waste any time on it, compile it with your C NOT YOUR C++ compiler, and then see what happens.
And please, don't...
As the error shows, you're trying to write to a location that is invalid.
fflush(stdin), used to work (sort of), on some compilers, years ago. It was heavily used by Turbo C help files and example...
In C, the '\' (backslash char), is an escape char, so strings with one \ in them, need to be doubled:
f = fopen("e:\final.txt", "w");
should be:
f = fopen("e:\\final.txt", "w");
or more...