Please explain why strcmp is opening with ingred[i] and not the filename?
If I remember correctly the format for strcmp is
strcmp(filename, "string")... or some sort of pointer...
Type: Posts; User: Spamtacus
Please explain why strcmp is opening with ingred[i] and not the filename?
If I remember correctly the format for strcmp is
strcmp(filename, "string")... or some sort of pointer...
Actually something does change, you're now getting a number instead of nothing....the question is..is the number what you're looking for..
btw, I sent you a PM...
Unfortunately, I do not know how to do what you're trying to do, like yourself, I'm a newbie at C as well...but I'd also like to know how to do that ...
Question though...why do you have ! infront...
Putting them in an array to read out on screen?
First you have to print out the header, which I assume you would like to do?
To print the header you use the fscanf with strings only (%s) and...
With respect to your filename calling it should be something like this...
printf("Please enter filename: ");
scanf("%s", Your_Filename);
Your_Pointer =...
You have to ask the person to enter the file name, using the printf and scanf statement...and when entering the file name you have to be sure to type "filename.txt" also making sure that the text...
Did you type .txt at the end?
Thanks man, it works!
The problem was what ragarshi stated....include the '\n' in the quotation marks after the %d and it'd work.
Can you give a sample code showing this? It's still a bit unclear...
Yes there's a header (which reads fine), the file is attached in the previous post, and the function is going to be doing more than that once I can get the integers to read properly...and ok, I'll...
#include <stdio.h>#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define text 200
#define inti 200
Yep, I've fixed that in the code but it's still a no go...the integers are still borked..
Well like I said before, everything BUT the integers (the date and numbers), are showing up properly.
I've checked and can't seem to find anything....
Lol, possibly
Hi, I'm new to the forum, and really new to C, but I'd like to get better...
I'm trying to read information from a text file with headers and info as well.
The header is printing fine, but the...