Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.18 seconds.

  1. Maybe for (int i = 0; i < resp->count; ...

    Maybe


    for (int i = 0; i < resp->count; i++)
    {
    // How to pass resp->info_entry here to the function func( ) & increment pointer?
    func( &resp->info_entry[i] );
    }
  2. Thread: I've been stuck.

    by Salem
    Replies
    4
    Views
    128

    Personally, I would go with char **teams and make...

    Personally, I would go with char **teams and make use of realloc to extend the array when you've reached some limit on the number of teams added.
  3. Replies
    6
    Views
    115

    while(isdigit(current)) Isn't going to exit,...

    while(isdigit(current))
    Isn't going to exit, because current never changes.
  4. Replies
    6
    Views
    115

    > n = 'current'- 0; Why the single quotes? ...

    > n = 'current'- 0;
    Why the single quotes?

    Why doesn't your compiler complain?
    C++ Shell
  5. Replies
    2
    Views
    154

    Since you don't care about the detail of how time...

    Since you don't care about the detail of how time is represented.

    TIME open_time, close_time, difference;
  6. Replies
    3
    Views
    141

    > return 0; Don't forget to clean up the...

    > return 0;
    Don't forget to clean up the malloc'ed memory which you're no longer using.
  7. Your choice of font colours is abominable.

    Your choice of font colours is abominable.
  8. > 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
  9. 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.
  10. > 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, " ");
  11. Thread: help with code!

    by Salem
    Replies
    5
    Views
    220

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

    Same as before.
    Help w/ my code
  12. 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.
  13. Replies
    5
    Views
    153

    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...
  14. Replies
    5
    Views
    153

    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...
  15. Replies
    1
    Views
    123

    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...
  16. 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.
  17. Thread: Help w/ my code

    by Salem
    Replies
    3
    Views
    250

    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 -...
  18. Replies
    7
    Views
    194

    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...
  19. Replies
    7
    Views
    194

    Your code doesn't compile.

    Your code doesn't compile.
  20. Replies
    7
    Views
    194

    > 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
  21. Replies
    4
    Views
    167

    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...
  22. Replies
    2
    Views
    184

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

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

    Reminds me of
    Turtle graphics - Wikipedia
    Logo (programming language) - Wikipedia
  24. > 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?
  25. Is this some kind of toy for young children?

    Is this some kind of toy for young children?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4