Recent content by dudforreal
-
D
Opening a Binary File in Command
I have 6 options in my code and it does create a binary file in my project folder when I press 4 but when I press 5 it doesn't work. printf("1. Add a car to the fleet.\n"); printf("2. Delete last car from the fleet.\n"); printf("3. Display full fleet on the screen.\n"); printf("4. Save...- dudforreal
- Post #6
- Forum: Programming and Computer Science
-
D
Opening a Binary File in Command
My program on Pelles C is creating a binary file when I want the results to save to a file but I'm not sure on how to open the binary file in cmd in Pelles C so that it is readable and I can read it.- dudforreal
- Post #4
- Forum: Programming and Computer Science
-
D
Opening a Binary File in Command
fopen is working void readFleet(Car_t toRead[]) { FILE *fFleet; fFleet = fopen("Fleet_File.bin", "rb"); fread(toRead, 10*sizeof(Car_t), 1, fFleet); fclose(fFleet); }- dudforreal
- Post #3
- Forum: Programming and Computer Science
-
D
Opening a Binary File in Command
How do you open a binary file in command in Pelles C so that it is readable?- dudforreal
- Thread
- Binary File
- Replies: 6
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
So through boolean, !x is testing x=1 and not the starting x=0?- dudforreal
- Post #17
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
How come the boolean is unchanged, isn't it changed in the two tables?- dudforreal
- Post #15
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
why are we only checking for x? what do you mean by modified?- dudforreal
- Post #13
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
Can you elaborate further so don't quite understand, isn't 1 true?- dudforreal
- Post #10
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
if 0 is false then !false is true which is 1 and it will repeat the loop?- dudforreal
- Post #8
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
I'm just curious why this code will work because it was part of a larger code and x was used as a check. When we got the desired result, x=1, wouldn't "!x" repeat the loop when we don't want it to repeat so to exit the loop?- dudforreal
- Post #6
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
From my code I want to check if the amount is less than 100 and to do this I use x to check, which I saw from the answer to a similar question- dudforreal
- Post #4
- Forum: Programming and Computer Science
-
D
Nested if statement within a do-while loop
I don't understand why this would work, shouldn't it be "while(x)" because we don't want to repeat the loop? int main(void) { int x=0; do { printf("Enter an amount:\n"); scanf("%lf", &amount); if (amount < 100) x=1; else printf("Invalid"); }while(!x); return 0; }- dudforreal
- Thread
- If statement Loop
- Replies: 18
- Forum: Programming and Computer Science
-
D
C programming compiling syntax errors
read and save to file still not working on code blocks any suggestions?- dudforreal
- Post #23
- Forum: Programming and Computer Science
-
D
C programming compiling syntax errors
i already fixed that issue thanks... the problem is that the read and save to file option still doesn't work even on Code Blocks- dudforreal
- Post #21
- Forum: Programming and Computer Science
-
D
C programming compiling syntax errors
i got the compiling to work but read and save to file still don't work on code blocks any suggestions?- dudforreal
- Post #19
- Forum: Programming and Computer Science