@UP
That helped, thanks!
Type: Posts; User: Pinkysuavo
@UP
That helped, thanks!
Oh, I forgot to mention important thing.
I said it looks for example
A 1 2
A 3 4
A 7 8 9 10
But I forgot to say that every line has a number before it.
So it looks like
1 A 1 2
2 A 3 4
3...
Yeah, I meant 2 or 4 values, but actually I'd like also to try to make it for example max 10 numbers. I think scanf will not be enough anymore?
Yeah, I made a lot of attempts already but every time I fail something.
In my mind it looks like
if fscanf returns 2 (values), then read 2 more values and go further
if fscanf returns 4 (values),...
Hello!
I have a reading from file inside my program.
My problem is I'm not sure how to make the program to check if there are either 2 or 4 elements to read in line.
Basically, it should read from...
I noticed also that my program had no sense. It worked cause I made it work on around 2 ,,checks" which were enough in case of my circuits.
That space after %s must have been some missclick, I...
First of all, thank you very much for your help. My code finally starts working.
But I have a little problem - I do not entirely understand how. At first, just after opening the file, I set all the...
Hello again. It turned out I have a little more time for the project. Today I've been working on it and I have a following problem:
I don't know how to loop the program to gather the information...
Oh haha, you wouldn't believe how long I've been trying to make my program works. I couldn't understand how the scanf and the whole loop works in this case. I wrote it with printf to check if it...
I'm sorry, I don't want to be rude. This forum is the only one I use. I use internet to search for articles when some detail is not clear for me, like for example usage of typedef was in this...
Sry again for double post but seems like I've been writing and analysing this for over an hour, and it's not possible to edit after this period of time.
PS I still don't know how I can read the...
I woke up having big ambitions to write this ......... Let's see if I can do anything today or I'll end up depressed again.
@UP I have no idea what's dynamic memory allocation, I don't know what are...
I don't have a textbook. I'm reading and practicing (via internet articles, tutorials and videos) now but I still stay in the same place with the project. I mentioned the things we had discussed on...
Lectures give nothing, just a theory which I can find anywhere. On classes we did either simple stuff like printing a textfile on screen with getc loop, or some hard stuff like linked lists that has...
Okay well looks like I won't finish this project. It's even harder than I thought
Sorry for double post, but I can't edit for some reason.
Matticus, your example was helpful and thank you for this, tho I still don't understand how my reading could go...
I was thinking about something like fopen, then fscanf, etc.. For example, when I made a program printing a content of textfile I used operations like fopen, fgetc, so I thought I can use similar...
Inputs (and all the circuit description) must come from a textfile
I don't get it. Why just 2 values? My text file can have any amount of them. My text file has many words, how my program can know which one is what? If it was always one line of text, for example...
To be clear: my gates must have 2 inputs (1 for NOT) and include only AND, OR, XOR, NOT. Data should be read from text file.
@Matticus I can do a program that reads information from text file and...
Looks like I am on lower level than I said. You helped me a little guys, but I don't know what is dynamic memory allocation for example, and many other things... Yeah I can google them, but I dont...
Hello. I have to do a multi-level logic gates simulation. Without graphics, it should just read the information about the circuit from for example text file, and then show every gate's logic output....