Yea that is what I figured, I was just wondering if there was a roundabout way to do it but I suppose there isn't! Thank's though!
Type: Posts; User: Eulogy
Yea that is what I figured, I was just wondering if there was a roundabout way to do it but I suppose there isn't! Thank's though!
Well I am overwriting the data in a file with new information, which I mean technically it would work to the viewer of the file (though would assume the information is gone even though the data is...
Is there anyway to int = NULL; perform more like ch = NULL;?
I am supposed to "delete" entries in a file that contains struct values (one int and one char), but when you NULL the int part of the...
Do you mean to use getchar();?
ch = getchar();
Alright I figured it out! I put an extra fseek after the write to manually position where it was pointing to after the initial read. Thanks for everyone's help! Now to clean up the code... wee fun. :)
I thought about it last night after reading my book and came up with this solution.
But it still isn't working perfectly.. so I'm still trying to debug it.
void deleteData(STR *deleteMe, FILE...
So this is where I'm at now. The program is still not changing the data in the .dat file.
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
Thanks for the help! I'll check everything out once I get home from work :)
yea I was using "r+b" or "rb+" fine but it doesn't seem to take the fwrite.
Well it overwrites it with nothing, when it opens the file with "wb" for some reason it opens it with 0 bytes in the file.
I figured out how to do part of the problem with this code
...
I tried doing that but for some reason opening it in "wb" erases all of the information. "r+b" is the only one that doesn't delete it.. I'll try it again though!
Hello all! First of all, happy thanksgiving!
Secondly, I'm having an issue overwriting data in a binary file.. here's my code..
#include <stdlib.h>#include <stdio.h>
#include <time.h>...
Hello I am trying to figure out how I can get an input that matches this printf..
printf("Enter an integer or character you would like to DELETE from the file:");
I tried this code..
...
Ok I was waaay overthinking it...
for (i = 0; i < FACES; i++)
if (facesInHand[i] > 0)
highest = i;
That should do the trick!
I think I figured it out a little bit but need help getting there
if in the debugger my array looks like this
facesInHand
[0] 0
[1] 0
[2] 1
[3] 0
[4] 1
Hey guys I'm having a little trouble figuring out how I can break a tie by the highest card face in a hand. If anyone has any suggestions that would be great!
#include <stdlib.h>
#include...