I can't get this to work.. I have a binary file that I would like to read in to a struct. The problem is that I only get the last record and the rest as empty records.. Let me clarify - the last...
Type: Posts; User: Machiaveli
I can't get this to work.. I have a binary file that I would like to read in to a struct. The problem is that I only get the last record and the rest as empty records.. Let me clarify - the last...
Great! I'll give both of your suggestions a go.
Thanks, again :-)
You can see my solution at the bottom of the first post. I edited it after I got the loop working.
I'll give you an example with the id-1 thingie:
printf("Enter ID: ");
scanf("%d",...
I tried the modulus operator but I never got that working to my favour.. Anyway, it works as it is now, I believe.
Thanks :-)
However, I have another question about scanf. I had to subract one...
I'm writing a program to compare two times. The user inputs the start time in a hour:minute:second type of way, that gets converted to seconds.
Next the user inputs a finish time, in the same...
How can you possibly keep track of all those "small" details? That small program took me the better part of the day to put together. Oh, it's wonderful being a noob :-) I really appreciate your help!...
Haha, everyone keeps bugging me about the stdin :-) I promise, I'll do my best to get rid of it asap. Thanks for helping me with the program. It works quite nicely now.. I also changed my puts to...
Well, that's actually the first thing I tried, but I get garbage for output. I thought it would be the logical choice.. Here's the code, and whenever I try to decrypt I get garbage.. There has to be...
I've tried different combinations, but I can't seem to get it right.. Something, somewhere, needs to increment, in order for it to allow more characters to be decrypted, and that's where I fail.....
Yes, well.. this will most certainly be embarrasing.. Functions is in the next chapter of our book.. :-) But I'll do my best and read up on what that "void encrypt" part of the code does. I'm...
Yes, I know about the fflush(stdin); issue, but I thought I would leave it as it is and concentrate on the encryption and decryption instead.
I've changed both my "Encrypted" and "Decrypted" part...
I need some help with a XOR program I'm trying to write.
I need to know if I'm on the right track here, and how I could decrypt it all. Reverse the process, so to speak. Please have a look at this...
Allright, if string "un" contains characters besides the ones we're interested in encrypting - send them (space in this case) to string "en" as is. Got it!
Thank, again :-)
I will read the...
After I initialized the array the output is correct, without any funny characters, but I can't seem to make it skip spaces, for example. I've tried some if conditions to have it ignore spaces, but it...
Thank you both! I'm starting to grasp the concept of how all that works.. It's my third week and we only have class a couple of hours a week, so it's hard to fully understand everything at once.
...
This is from another thread here at cprogramming.com. The gentleman that I stole the code snippet from is joshdick. He explained what every part of the code does, but I just don't get it..
This...
Sure, a = 97, b = 98, different codes for different characters. But why take away a, it's the logic behind it all that I just don't understand. Why remove the a to begin with? I'm sorry, I'm really...
Right.
No.
Pretty much.
So, let me get this straight.. When you don't understand something you just go: "It wasn't for me anyway"? I guess that's why you felt the need to make stupid...
AH! You're a lifesaver! I've been sitting in front of my computer for who knows how long and I wanted to figure it out by myself but I was getting too tired and it's close to midnight here so at...
Allright, I've changed the loop to
for ( i = 0; i < un[51] && i != '\0'; i++ )
en[i] = (((un[i] - 'a') + offset) % 26) + 'a';
But still, no output. Why won't this work? How...
I need some help with my program - a simple caesar cipher program. I'll come clean and admit that this is for a college class I'm taking. The assignment was to build a program that could encrypt...