Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.16 seconds.

  1. Replies
    1
    Views
    137

    Are you allowed to do things like - copy found...

    Are you allowed to do things like
    - copy found entries into a list that only contains unique instances
    - clone the list you have so you're free to remove all duplicates

    > 1,2,1,1,3,4
    The tricky...
  2. Thread: Date validation

    by Salem
    Replies
    1
    Views
    80

    Something like this tProduct milk;...

    Something like this


    tProduct milk;
    dateInit(&milk.bestBeforeDate, 25, 12, 2020 );
  3. $ gcc -Wall -g foo.c $ gdb -q ./a.out Reading...

    $ gcc -Wall -g foo.c
    $ gdb -q ./a.out
    Reading symbols from ./a.out...done.
    (gdb) run
    Starting program: a.out
    ^C
    Program received signal SIGINT, Interrupt.
    0x000000000040075b in main () at...
  4. Yeah, you need to show your edits.

    Yeah, you need to show your edits.
  5. > void main() main returns an int. >...

    > void main()
    main returns an int.

    > if(Change < '0')
    You probably want to remove the single quotes from every one of your comparisons.

    '0' == 48 (in ASCII)

    So yeah, it's a valid test, but...
  6. Replies
    6
    Views
    188

    Can you describe in words what reall is supposed...

    Can you describe in words what reall is supposed to do?

    Is it supposed to be like 'copy' but for matrices with different sizes?
  7. Replies
    2
    Views
    82

    So 10 hours before this, you only had 30...

    So 10 hours before this, you only had 30 minutes...
    Can anyone do this program for me in the next 30 minutes?

    If you want help, you NEED to make an effort.
    You're not going to get code on a...
  8. Procrastination - Wikipedia...

    Procrastination - Wikipedia
    and
    Hail Mary pass - Wikipedia
  9. What is the scope and lifetime of myobj ? If...

    What is the scope and lifetime of myobj ?

    If you're doing this


    MyClass *obj = new MyClass;
    std::thread t(&MyClass::MyMethod, myobj);

    and MyMethod has the ability to do say delete this; as...
  10. Replies
    11
    Views
    216

    Looks good so far with the enum. In main, you...

    Looks good so far with the enum.

    In main, you need to call the function with a value.


    int main () {
    int a;

    printf("Welcome player. Please enter your class type:");
    ...
  11. Replies
    1
    Views
    118

    The %s format only reads printable characters. ...

    The %s format only reads printable characters. It ignores all white space, and that includes new lines.

    To read an actual line, spaces and a newline at the end, use the fgets function.

    As in...
  12. Replies
    10
    Views
    235

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

    Also here -> Compiling project in c/c++ - Missing ste - C++ Forum
  13. Replies
    11
    Views
    216

    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;
  14. Replies
    2
    Views
    96

    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...
  15. Replies
    6
    Views
    190

    > 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...
  16. Replies
    5
    Views
    205

    > 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...
  17. Replies
    5
    Views
    205

    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.

    ...
  18. Replies
    4
    Views
    136

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

    Is the ":" a useful delimiter?

    If so, strchr() is your friend.
  19. Replies
    5
    Views
    205

    > 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...
  20. Replies
    2
    Views
    198

    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.
  21. 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] );
    }
  22. Thread: I've been stuck.

    by Salem
    Replies
    6
    Views
    303

    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.
  23. Replies
    6
    Views
    199

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

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

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

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

    Why doesn't your compiler complain?
    C++ Shell
  25. Replies
    2
    Views
    231

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