Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.20 seconds; generated 4 minute(s) ago.

  1. Replies
    8
    Views
    158

    Also here -> Compiling project in c/c++ - Missing...

    Also here -> Compiling project in c/c++ - Missing ste - C++ Forum
  2. Replies
    4
    Views
    93

    Your player info is all wrong. typedef enum...

    Your player info is all wrong.


    typedef enum { mage, warrior, healer } role;
    typedef struct {
    role role;
    char name[20];
    int level;
    } player;
  3. Replies
    2
    Views
    69

    It's an impressive rewrite in about an hour,...

    It's an impressive rewrite in about an hour, since it was only 2 hours ago you were begging for code.
    Need help with this code



    void init_deck(struct card *deck)
    {
    /* If the deck does...
  4. Replies
    6
    Views
    167

    > I compelete like 70% from the code .. I'd give...

    > I compelete like 70% from the code ..
    I'd give it 30% finished.

    You've made a reasonable job of shuffle.

    The next task would be a function called 'deal'.
    One thing you need to keep track of...
  5. Replies
    5
    Views
    175

    > I'm sorry but I just cannot seem to find the...

    > I'm sorry but I just cannot seem to find the error.
    You count each opening brace, and each closing brace.
    When one isn't in a place you expect, you've found a problem.

    You can do yourself a...
  6. Replies
    5
    Views
    175

    Well sloppy indentation means you lose track of...

    Well sloppy indentation means you lose track of where all the open / close braces are supposed to go.

    Your 'main' really ends at line 126.
    Figure out where your braces should be.

    ...
  7. Replies
    4
    Views
    118

    Is the ":" a useful delimiter? If so, strchr()...

    Is the ":" a useful delimiter?

    If so, strchr() is your friend.
  8. Replies
    5
    Views
    175

    > fflush(stdin); This doesn't do what you think...

    > fflush(stdin);
    This doesn't do what you think it does. Remove it.




    if(numOfInputRead==1 && isValid(M)==1)
    break;
    else if (numOfInputRead == 0) {
    printf("Invalid number. Please...
  9. Replies
    2
    Views
    179

    That seems like a good approach to me. You'll...

    That seems like a good approach to me.

    You'll need at least a couple of GB of free space for vbox to create the virtual disk that will be used for your Linux distro.
  10. 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] );
    }
  11. Thread: I've been stuck.

    by Salem
    Replies
    6
    Views
    284

    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.
  12. Replies
    6
    Views
    191

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

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

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

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

    Why doesn't your compiler complain?
    C++ Shell
  14. Replies
    2
    Views
    214

    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;
  15. Replies
    3
    Views
    187

    > 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.
  16. Your choice of font colours is abominable.

    Your choice of font colours is abominable.
  17. > 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
  18. 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.
  19. > 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, " ");
  20. Thread: help with code!

    by Salem
    Replies
    5
    Views
    274

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

    Same as before.
    Help w/ my code
  21. 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.
  22. Replies
    5
    Views
    195

    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...
  23. Replies
    5
    Views
    195

    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...
  24. Replies
    1
    Views
    151

    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...
  25. 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.
Results 1 to 25 of 498
Page 1 of 20 1 2 3 4