Fixed! Thanks!
Sorry about that. I've put them all into their own functions now
Totally right... lesson learned.
Type: Posts; User: mercuryfrost
Fixed! Thanks!
Sorry about that. I've put them all into their own functions now
Totally right... lesson learned.
Changes (attempted!) made!
Thanks guys for your time!
#include <stdio.h>
#include "list.h"
#include <stdlib.h>
Many thanks for feedback Tabstop and Salem.
I've attemtped to implement the changes you suggested, but was unsure of where or how to implement the two mentioned above.
The current...
I did say it was 'terrible, ignorant' code. :)
Ya, I guess stupid syntax errors are my first problem... amongst many.
If I could make it compile I would. I'm very new to C, and I apologise...
Hi all,
for any of you who shiver at ignorant, terrible code, just press 'back' now.
Assignment where I have to use a header and .c file to implement an abstract data type for lists containing...
I think I had already changed that when you had posted.
Did I?
Or is it this you're referring to?
infp = open(argv[j], O_RDONLY);
If that won't work, any suggestions?
Ah okay,
Changes made.
Still the same problem persists. The input files input isn't being read
I think the problem is with the read statement...
Tidied a bit
Well I thought that O_CREAT would create the file and open it. Or just open it if it already exists.
O_APPEND wouldn't open it if the file didn't exist would it?
Well that was my thinking...
As a progression from the first thread,
which was solved, using fread fscanf fprintf and fclose
(http://cboard.cprogramming.com/c-programming/118778-fscanf-seg-fault.html)
I'm trying to write...
@ Tabstop, that doesn't seem to work either.
Actually, since it's a different problem,
I'll start a new thread.
The original issue in this thread was solved with all of your help, thanks!
@tabstop.
That seems to open a man for other things.
Open gives man page for openvt, write for messages to users etc...
As regards the program above,
It seems to be compiling fine and...
It's another part of the assignment.
Most stuff online seems to be giving out that open etc aren't real C, rather than telling me how to use them compared to the others!
I'm working through the...
@ Tabstop
Yep, well as I said, this is my first go at C
Embarrassment is secondary to learning! :)
Okay...
Not sure what I changed to make it work, but with a few little changes this code...
Must use fscanf unfortunately.
Also, What do you mean by OOPS tabstop?
OKay,
Well it's compiling again,
but I'm back to having a seg fault
Is there perhaps a more standard way to run through an undefined number of arguments? This was just what I thought up.
I...
GCC
first with pedantic, then without, same error
Thanks for the answers guys.
With the argv[j],
I was trying to increment the value of 'j' to go through all the arguments until i was 0.
I've tried to add an error check to see if fopen...
Hi all,
BRAND new to programming in C.. in fact this is my first real program.
I have an assignment I've been trying to complete and I'm getting an error (seg fault) I was hoping someone could...