Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.29 seconds; generated 40 minute(s) ago.

  1. Thread: Task creations

    by Salem
    Replies
    5
    Views
    145

    It's all in the previous threads.

    It's all in the previous threads.
  2. Thread: Task creations

    by Salem
    Replies
    5
    Views
    145

    You mean you got nothing from your previous...

    You mean you got nothing from your previous threads?
    How do you design scheduler ?
    Top design- real time operating system
    How to write code for round robin scheduling
    Free rtos code example 1...
  3. Replies
    5
    Views
    149

    codeblocks-20.03mingw-setup.exe is an all-in-one...

    codeblocks-20.03mingw-setup.exe is an all-in-one package.
    You just install it, and you get the compiler, debugger, editor all wrapped up for you.

    There is nothing else needed to start writing...
  4. Replies
    5
    Views
    149

    Eclipse is just an IDE. It doesn't come with a...

    Eclipse is just an IDE.
    It doesn't come with a compiler, hence the "g++ not found in PATH" messages.

    If you want an all-in-one complete package, try code::blocks.
    Binary releases - Code::Blocks...
  5. A couple of basic things first before trying more...

    A couple of basic things first before trying more advanced things.

    > fgets(hraci[id_hraca].meno,50,stdin);
    Don't lie about your buffer sizes.

    Use sizeof on the array you're reading into, like...
  6. Replies
    2
    Views
    118

    You could make a union out of it. typedef...

    You could make a union out of it.


    typedef struct
    {
    uint8_t type;
    uint8_t num;
    uint8_t id;
    union {
    int value;
  7. Replies
    3
    Views
    127

    I suppose the first question would be,...

    I suppose the first question would be, whereabouts in the world are you geographically located (country/state or equivalent).

    Second question, how far are are you willing to relocate?

    > I'm a...
  8. Replies
    5
    Views
    153

    Your concatenate is fine, so long as your array...

    Your concatenate is fine, so long as your array has a NULL sentinel value at the end.

    No sentinel, then you need to provide a count of how many elements there are.
  9. Replies
    5
    Views
    153

    As far as the compiler is concerned, a string...

    As far as the compiler is concerned, a string constant is represented as an anonymous char array.

    So your first post is


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    const...
  10. Replies
    5
    Views
    153

    It's not comparing strings, it's comparing...

    It's not comparing strings, it's comparing pointers.

    And it relies on the compiler combining identical strings, so that the pointer to "" in the array is the same pointer to "" in the while...
  11. Replies
    4
    Views
    184

    > char **result = malloc(sizeof(char)); This...

    > char **result = malloc(sizeof(char));
    This doesn't allocate anywhere near enough space.
    At the very least, you need to start with


    char **result = malloc(sizeof(char*));


    Additionally,...
  12. Replies
    4
    Views
    173

    p no longer points to the start of your array. ...

    p no longer points to the start of your array.

    So you print the tail end of the array, then whatever 'garbage' there is in memory.
  13. Replies
    3
    Views
    180

    Did you look up what strcmp returns, or did you...

    Did you look up what strcmp returns, or did you just guess that it returns "true" when the strings are equal?
  14. Thread: Username change

    by Salem
    Replies
    1
    Views
    222

    Send a PM to...

    Send a PM to https://cboard.cprogramming.com/member.php?u=1
  15. Thread: smallest coin

    by Salem
    Replies
    2
    Views
    221

    Also here -> coin smallest - C++ Forum...

    Also here -> coin smallest - C++ Forum
  16. Replies
    4
    Views
    258

    > if(fscanf(fd, "%s:%[^:]:%s:%d:%d:%d:%d:%d",...

    > if(fscanf(fd, "%s:%[^:]:%s:%d:%d:%d:%d:%d", flag, nom, s, &st1, &st2, &st3, &po, &ti) != 8)
    Maybe try == 8 instead.

    In fact, this is better.


    char buff[BUFSIZ];
    while (...
  17. Replies
    17
    Views
    488

    > But I fail to see why pointer arithmetic and...

    > But I fail to see why pointer arithmetic and indirection, plus pos-increment are "obfuscation".
    For the OP, I'm pretty damn sure that what you posted would count as obfuscated.

    As for all the...
  18. Replies
    17
    Views
    488

    Any decent compiler will do that optimisation for...

    Any decent compiler will do that optimisation for you, without making the code obscure in the process.
  19. Replies
    17
    Views
    488

    > a[b] = a[b]+2; Compare with a[b] =...

    > a[b] = a[b]+2;

    Compare with
    a[b] = a[b-1]+2;

    And you want to do <10 for both loops.
  20. Something wrong with your setup if you're not...

    Something wrong with your setup if you're not getting any errors.


    $ gcc -Wall -ansi -pedantic foo.c
    foo.c: In function ‘cmd_line’:
    foo.c:31:21: warning: statement with no effect...
  21. Replies
    17
    Views
    488

    > printf ("%d\n", a[i]); Yah think this should...

    > printf ("%d\n", a[i]);
    Yah think this should be a different subscript as well?

    > for (b=0;b<9;b++)
    a[0] is already set, so perhaps this loop should start at 1.

    Also, think about what "this...
  22. Replies
    17
    Views
    488

    > a[i] = a[i]+2; Perhaps you should use [b] as...

    > a[i] = a[i]+2;
    Perhaps you should use [b] as your array subscript.
  23. Thread: ordering system

    by Salem
    Replies
    5
    Views
    232

    This is an error message. foo.c:82:11:...

    This is an error message.


    foo.c:82:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    82 | if (flag = 0)
    | ^~~~


    You've posted...
  24. Thread: ordering system

    by Salem
    Replies
    5
    Views
    232

    What is the actual error message? How did you...

    What is the actual error message?

    How did you declare choice?

    What is ext() ?

    This isn't a game of 20 questions to try and get you to show a decent amount of information that would enable us...
  25. Thread: ordering system

    by Salem
    Replies
    5
    Views
    232

    Well you need to post more than the fragment of...

    Well you need to post more than the fragment of one line of code.
Results 1 to 25 of 491
Page 1 of 20 1 2 3 4