Search:

Type: Posts; User: steez

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    2,923

    This is definitely more of a question than an...

    This is definitely more of a question than an answer, but could the OP create a new thread and then call something like (sleep) within that thread?
  2. Replies
    5
    Views
    3,434

    Ah I see. Then in this case, sizeof(struct...

    Ah I see.
    Then in this case, sizeof(struct whatever) probably doesn't take into consideration the types of data in the struct but rather how many elements there are?
  3. Replies
    5
    Views
    3,434

    What does this struct look like in memory?

    struct student {
    char id;
    char *name;
    int grade;
    };

    int main ()
    {
    struct student school[2];
  4. Replies
    9
    Views
    1,108

    Thank you for the clarification. Still, in what...

    Thank you for the clarification.
    Still, in what types of errors should I return EXIT_FAILURE? See the above post.
  5. Replies
    5
    Views
    1,702

    What am I missing here? I don't see why you can't...

    What am I missing here? I don't see why you can't just exactly copy all of the file byte for byte.
  6. Replies
    9
    Views
    1,108

    What about returning zero and nonzero within int...

    What about returning zero and nonzero within int main(), for instance? Is it pretty much at your discretion for which errors would correspond with returning nonzero?

    Example:

    int main ( int...
  7. Replies
    9
    Views
    1,108

    Ok, I see. Thank you!

    Ok, I see. Thank you!
  8. Replies
    9
    Views
    1,108

    This still requires more and more indentation for...

    This still requires more and more indentation for every time you check for a new, different error as the function continues; you don't think much of it?
  9. Replies
    9
    Views
    1,108

    Errors & Returning Values

    Which code is appropriate/for what situations should each of these methods of handling an error be used?


    if (error)
    {
    printf("error message here");
    }
    else
    {
    // continue as normal
  10. Replies
    8
    Views
    1,519

    Yes, I made a mistake, I thought the %p took care...

    Yes, I made a mistake, I thought the %p took care of that for me (I thought I was supposed to pass the pointer's address to it for some reason, which makes no sense in retrospect).
    I edited my above...
  11. Replies
    8
    Views
    1,519

    Edit: nevermind. I couldn't get the %x version to...

    Edit: nevermind. I couldn't get the %x version to work the same as the %p version, but now I have:


    #include <stdio.h>
    int main ()
    {
    int myArray[] = {5, 6, 7, 8};
    int * myPointer =...
  12. Replies
    8
    Views
    1,519

    What's the best way to do this? Pretty much any...

    What's the best way to do this? Pretty much any way I try it, I get what I expected -- the compiler automatically takes into account the size of the variable. However, now I'm curious. Here's my...
  13. Replies
    8
    Views
    1,519

    Pointing to the next character in an array?

    Example:

    int myArray[] = {5, 6, 7, 8};
    int *myPointer = &myArray[0]

    Why is the following true?

    *(myPointer+1) == 6

    I get the concept, but shouldn't this only hold true if the variable is...
  14. Replies
    6
    Views
    5,383

    I'm not printing it to view as output, rather I'm...

    I'm not printing it to view as output, rather I'm writing to a file to encrypt the file (e.g. a .txt file or a .jpg). For this reason it makes much more sense that I should have just used fwrite() to...
  15. Replies
    6
    Views
    5,383

    Ah, ok. I don't know why I didn't think to do...

    Ah, ok. I don't know why I didn't think to do this... I had been using fread() and such and yet for some reason used fputs() instead of just fwrite().

    Thank you very much!
  16. Replies
    6
    Views
    5,383

    XOR encryption is null-terminating my strings!

    I'm dealing with two strings, one being the string that I want to encrypt using XOR encryption and one being my "key" that I XOR the original string against.

    for (a simplified) example:

    while (...
Results 1 to 16 of 16