Search:

Type: Posts; User: Machiaveli

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    2,266

    fread records into a struct

    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...
  2. Replies
    7
    Views
    5,444

    Great! I'll give both of your suggestions a go. ...

    Great! I'll give both of your suggestions a go.
    Thanks, again :-)
  3. Replies
    7
    Views
    5,444

    You can see my solution at the bottom of the...

    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",...
  4. Replies
    7
    Views
    5,444

    I tried the modulus operator but I never got that...

    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...
  5. Replies
    7
    Views
    5,444

    Easy way to compare two times

    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...
  6. Replies
    14
    Views
    2,811

    How can you possibly keep track of all those...

    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!...
  7. Replies
    14
    Views
    2,811

    Haha, everyone keeps bugging me about the stdin...

    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...
  8. Replies
    14
    Views
    2,811

    Well, that's actually the first thing I tried,...

    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...
  9. Replies
    14
    Views
    2,811

    I've tried different combinations, but I can't...

    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.....
  10. Replies
    14
    Views
    2,811

    Yes, well.. this will most certainly be...

    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...
  11. Replies
    14
    Views
    2,811

    Yes, I know about the fflush(stdin); issue, but I...

    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...
  12. Replies
    14
    Views
    2,811

    XOR encryption

    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...
  13. Replies
    17
    Views
    6,782

    Allright, if string "un" contains characters...

    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...
  14. Replies
    17
    Views
    6,782

    After I initialized the array the output is...

    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...
  15. Replies
    17
    Views
    6,782

    Thank you both! I'm starting to grasp the concept...

    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.
    ...
  16. Replies
    17
    Views
    6,782

    This is from another thread here at...

    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...
  17. Replies
    17
    Views
    6,782

    Sure, a = 97, b = 98, different codes for...

    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...
  18. Replies
    17
    Views
    6,782

    Right. No. Pretty much. So, let me...

    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...
  19. Replies
    17
    Views
    6,782

    AH! You're a lifesaver! I've been sitting in...

    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...
  20. Replies
    17
    Views
    6,782

    Allright, I've changed the loop to for ( i =...

    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...
  21. Replies
    17
    Views
    6,782

    Caesar encryption

    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...
Results 1 to 21 of 21