Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.19 seconds.

  1. > if (b->grid[j] == b->grid[i]) You're not...

    > if (b->grid[j] == b->grid[i])
    You're not comparing characters, but the (address of) the start of two arrays of characters.

    Which will be of course the same if i == j
  2. You need to use fread() and fwrite() if you're...

    You need to use fread() and fwrite() if you're working with binary data.

    And buf[i] when looping through the buffer.
  3. > pthread_create(&race->runners[i], NULL,...

    > pthread_create(&race->runners[i], NULL, goRunner(RunnerType*), " ");
    You don't specify the type.

    pthread_create(&race->runners[i], NULL, goRunner, " ");
  4. Thread: help with code!

    by Salem
    Replies
    5
    Views
    142

    Same as before. Help w/ my code...

    Same as before.
    Help w/ my code
  5. Question 20.15c...

    Question 20.15c

    Use a temporary variable in your code.
    It's a lot clearer to basically anybody what your intention is.
  6. Replies
    5
    Views
    118

    Stop using scanf_s until you've read the manual....

    Stop using scanf_s until you've read the manual.
    scanf_s, _scanf_s_l, wscanf_s, _wscanf_s_l | Microsoft Docs

    You have to pass additional parameters.
    It's not a simple matter of just putting _s...
  7. Replies
    5
    Views
    118

    There is no such thing as extending an array....

    There is no such thing as extending an array.
    Either you have an array (of fixed size), or you have dynamically allocated memory.

    You do have to be careful with your use of & in scanf calls...
  8. Replies
    1
    Views
    84

    Something like this is simple enough for...

    Something like this is simple enough for homework.


    int getNextId(void) {
    static int id = 0;
    return id++;
    }

    Being declared static, the id variable will remember the last value it had...
  9. You're going to be explaining your metaphores...

    You're going to be explaining your metaphores more often than you'll be explaining the real concepts to begin with.
  10. Thread: Help w/ my code

    by Salem
    Replies
    3
    Views
    197

    Some initial observations. 1. main must be...

    Some initial observations.
    1. main must be specified as returning an int.
    Implicit return types became obsolete in 1989 with the first C standard.

    2. Never EVER use gets()
    gets, gets_s -...
  11. Replies
    7
    Views
    152

    Well it might compile, but you need to compile...

    Well it might compile, but you need to compile this 'C' code using a C++ compiler.
    So I made your 'const int' a #define instead.


    $ g++ -D_GNU_SOURCE -Wall main.c
    $ gcc -D_GNU_SOURCE -Wall...
  12. Replies
    7
    Views
    152

    Your code doesn't compile.

    Your code doesn't compile.
  13. Replies
    7
    Views
    152

    > where is my mistake? How do we know what you...

    > where is my mistake?
    How do we know what you were expecting?

    You shouldn't be calling printf in signal handlers.
    signal-safety(7) - Linux manual page
  14. Replies
    4
    Views
    139

    Consider breaking out part of the calculation, so...

    Consider breaking out part of the calculation, so you can separately verify it.


    #include <stdio.h>
    #include <math.h>
    int main(void)
    {
    int year;
    double cobalt_initial;
    printf("Please...
  15. Replies
    2
    Views
    163

    Cross-posted here -> return value in a C function...

    Cross-posted here -> return value in a C function - C++ Forum
  16. Reminds me of Turtle graphics - Wikipedia...

    Reminds me of
    Turtle graphics - Wikipedia
    Logo (programming language) - Wikipedia
  17. > I have never done anything like that (beginner...

    > I have never done anything like that (beginner to C programming)
    But you're an experienced programmer in some other language - right?
  18. Is this some kind of toy for young children?

    Is this some kind of toy for young children?
  19. Replies
    3
    Views
    151

    Bored waiting for a build.... #include...

    Bored waiting for a build....


    #include <stdio.h>

    struct store {
    int Orange;
    int Apple;
    int Pear;
    };
  20. The cast won't help if the underflow has already...

    The cast won't help if the underflow has already happened.
  21. Replies
    3
    Views
    151

    Pretty awful. - global variables -...

    Pretty awful.
    - global variables
    - checkChoice() and mainMenu() in a mutually recursive death spiral.
  22. Replies
    8
    Views
    306

    Simples! qs = z; do { qs = dsum(qs); }...

    Simples!


    qs = z;
    do {
    qs = dsum(qs);
    } while ( qs >= 10 );
  23. Replies
    6
    Views
    193

    Because &RXData is a pointer to the whole array,...

    Because &RXData is a pointer to the whole array, whereas RXData and &RXData[0] are pointers to the first element of the array.

    Write char (*rxMssg)[20] = &RXData;
    if you want to point to the...
  24. Replies
    8
    Views
    306

    What's your question? Your code gives the right...

    What's your question?
    Your code gives the right answer.
  25. Replies
    2
    Views
    176

    Despite the name, kill doesn't kill a process per...

    Despite the name, kill doesn't kill a process per se.
    Whether a process actually dies depends on the nature of
    a) the signal being sent.
    b) what signal handling the recipient task has installed.
    ...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4