Thanks...I will try that.
Type: Posts; User: krsauls
Thanks...I will try that.
It did not find the \0. Here is the code where I read in the strings:
int count = 0;
//loop to get the coordinats and name of the patch
while(fgets(line, sizeof(line),...
Not sure, although I do remember now that strcmp requires this, no? How can I figure out if they do?
I'm having problems getting an equality with strcmp. Here is my code:
char myframe[frameheight][framewidth];
patch pptr;
patch *p;
p = &pptr;
command cptr;
command...
You da man. That got it...I guess my logic works after all, eh?
Hey, fellas, I really appreciate it. It helps to have a second eye. I'll have to buy y'all a beer sometime.
OK. Here is the complete function. Things are fine until I try to fill my array with the patches from the file input. I will repost that here:
rect
7 9
+-------+
| |
| |
| ...
Hell, I trust them more than mine! HA. I will give it a go...thanks.
How about this?
Can I use a pointer in my structure and get it to point to an array that has been declared?
My struct
typedef struct {
Alright. That sounds good to me. Thank you.
Can it be done? And if so, would this be appropiate if my structure was already created?
patch mystructures[10];
patch p;
patch *pptr;
pptr = &p;
.
.
I got it going now.
fscanf(patches,"%d %d", p->height, p->width);
should have had the & before the variables...8)
fscanf(patches,"%d %d", &p->height, &p->width);
Tried this out and it causes my program to cras when it hits this line.
Partial snippet:
while(fgets(line, sizeof(line), patches) != NULL) {
strcpy(p->name, line);
...
Iwill try that out...thanks.
i guess my real question is, how can I read the second line
7 9
in as two separate integers?
I tried reading the line in as a char array and creating tokens, but when I cast them like...
Hello, I need a little help reading input from a file and placing it into a structure.
The file looks like this:
rect
7 9
+-------+
| |
| |