Search:

Type: Posts; User: oogabooga

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    12
    Views
    619

    I didn't realize you were so fragile. You sure...

    I didn't realize you were so fragile.
    You sure like name-calling, though.
  2. Replies
    12
    Views
    619

    && yields 1 if and only if both it's operands are...

    && yields 1 if and only if both it's operands are non-zero; otherwise it yields 0.


    || yields 0 if and only if both of it's operands are 0; otherwise it yields 1.
  3. Replies
    12
    Views
    619

    Are you some kind of paranoid associativity...

    Are you some kind of paranoid associativity fanboy? I think you mean precedence.
  4. Replies
    12
    Views
    619

    You need to consider the precedence and the...

    You need to consider the precedence and the parentheses. The part in the parens is computed first.
    Within the parens, the && has higher precedence, so the first thing that's computed is 1 && 0,...
  5. Replies
    3
    Views
    620

    Firstly, remember that the equality operator is...

    Firstly, remember that the equality operator is ==, not just =. You need to change this in your if conditions.

    Even with this change it's difficult to understand what your code is trying to do....
  6. Replies
    4
    Views
    1,106

    You're not "assigning" it that value. You're...

    You're not "assigning" it that value. You're "anding" that value with it's current value. CSIZE is a mask with 1's in the position of the bits that encode the characters size. By complementing that...
  7. 1. Declare main as int main(void), not void...

    1.
    Declare main as int main(void), not void main() (which is not a standard declaration and yields no benefit). And put a return 0 statement at the end of main.

    2.
    Remove the fflush(stdin) calls...
  8. Replies
    7
    Views
    668

    C99 has the z length modifier for the size_t...

    C99 has the z length modifier for the size_t type.


    printf("%zu", strlen(str));
  9. Replies
    25
    Views
    2,045

    Without threads the program simply rotates around...

    Without threads the program simply rotates around the various tasks, performing a little of each at a time, and it does it so quickly it looks like they're all happening at the same time.

    However,...
  10. Replies
    29
    Views
    3,313

    @Soma, I agree with pretty much all you said,...

    @Soma,

    I agree with pretty much all you said, though to ask what fflush(stdin) does is not relevant since it is presumably documented by MS. I don't know and I don't care because I've never used...
  11. Replies
    29
    Views
    3,313

    @Soma: How can a If it's undefined, it's...

    @Soma:

    How can a

    If it's undefined, it's undefined. Undefined means that the implementation is able to do absolutely anything it wants to. It's under no obligation to trash memory, erase the...
  12. Replies
    29
    Views
    3,313

    I don't feel you're being harsh or trying to...

    I don't feel you're being harsh or trying to start anything. :) I'm interested in this discussion and I know that I have it at least partly wrong.

    I've been reading the standard lately and am...
  13. Replies
    29
    Views
    3,313

    I did "warn him off" by telling him it was...

    I did "warn him off" by telling him it was non-portable.
    "Undefined behavior" is a portability issue. That was my point.
    I don't recall "teaching" (or using) fflush(stdin).



    I realize that...
  14. Replies
    29
    Views
    3,313

    "Undefined behavior" simply means that the...

    "Undefined behavior" simply means that the standard does not define a behavior for it. That's all. Any particular implementation is free to define a behavior for it and still perfectly conform to the...
  15. Replies
    29
    Views
    3,313

    To protect against such buffer overflows you can...

    To protect against such buffer overflows you can use fgets to read the file a line at a time. This function puts a limit on how much it reads, so it won't overflow the buffer. Since you have to pick...
  16. Replies
    29
    Views
    3,313

    You should include ctype.h (for isalpha and...

    You should include ctype.h (for isalpha and isdigit).

    You should use getchar (instead of the non-standard getch).

    spac is "unused" (and doesn't have enough space to hold a string with a single...
  17. Replies
    29
    Views
    3,313

    You talk about reading and writing to files as if...

    You talk about reading and writing to files as if that can't possibly affect any other variables. But if one of those reads overflows a buffer, that data can run into the other variables' memory.
    ...
  18. Replies
    10
    Views
    3,335

    Putting your code together with my changes and...

    Putting your code together with my changes and entering 20 and 100 yields:


    +--------------------+
    | |
    | |
    | |
    | |...
  19. Replies
    10
    Views
    3,335

    You're running your function twice for each...

    You're running your function twice for each iteration.
    Try this (untested) :


    for(int i = 0; i < anzSchritte; i++){
    if((nextStep(insectZeiger, laenge, raster)) == 3){
    ...
  20. Replies
    10
    Views
    3,335

    You have duplicate code. And you could use a...

    You have duplicate code. And you could use a switch.


    int nextStep(struct Ameise* ant, int len, char antarena[][len]){
    switch (antarena[ant->y][ant->x]) {
    case ' ':
    ...
  21. Replies
    35
    Views
    2,269

    That's not what I grow. And it sounds like you...

    That's not what I grow. And it sounds like you might have been smoking a little of your imaginary "synthetic" marijuana.

    Naaaaah, I'm just yankin' yer chain!
    G'nite.
  22. Replies
    35
    Views
    2,269

    I'm glad you're getting all the evil mariHuana...

    I'm glad you're getting all the evil mariHuana people off the streets.
    I feel so much safer.
  23. Replies
    35
    Views
    2,269

    I don't find marijuana offensive.

    I don't find marijuana offensive.
  24. Replies
    8
    Views
    642

    Another common (and probably better) alternative...

    Another common (and probably better) alternative is to have a separate List struct:


    typedef struct List {
    DLLNode *head;
    DLLNode *tail;
    size_t size;
    } List;

    You'd initialize...
  25. Replies
    8
    Views
    642

    Please post code that compiles, which means...

    Please post code that compiles, which means including all headers.
    Even adding headers, you still have an error (DLLNode does not have a member called i).
    And since you're compiling with -g,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4