Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.21 seconds.

  1. > I mean more practical way to learn how the...

    > I mean more practical way to learn how the instructions translate to binary like a specification,
    That information is in the processor reference manual (for whichever machine you're interested...
  2. Thread: Shell commands

    by Salem
    Replies
    3
    Views
    79

    -Werror is one way Redirecting the stderr of...

    -Werror is one way

    Redirecting the stderr of the compilation to a file, and checking whether that file is empty is another.
  3. > I would prefer something more practical cause...

    > I would prefer something more practical cause this will be a pain to do
    That's why we use assemblers and compilers, so we don't have to do that.

    But hey, you wanted to do it all by yourself.
  4. Thread: Shell commands

    by Salem
    Replies
    3
    Views
    79

    Look at $? gcc -g -Wall -Wextra -pedantic...

    Look at $?



    gcc -g -Wall -Wextra -pedantic -std=c11 try40.c -lm -o try40.out
    if [ $? -eq 0 ]; then ./try40.out ; fi
  5. Maybe this The elfutils project...

    Maybe this The elfutils project

    Dunno, it's one of those esoteric things to want to do.
    Like you're the maintainer for binutils and you're porting to a completely new architecture.

    Enjoy.

    $...
  6. Replies
    1
    Views
    142

    For something that simple, just use an inline...

    For something that simple, just use an inline function.


    static inline void exit_the_prog() {
    printf("Error: There was an error with the program");
    exit(2);
    }


    Templates are for...
  7. Replies
    1
    Views
    110

    Well posting what your 'Reversi_t' type looks...

    Well posting what your 'Reversi_t' type looks like would be a big help.
  8. Thread: Task creations

    by Salem
    Replies
    7
    Views
    240

    Sure, why not - let's see how far you can run...

    Sure, why not - let's see how far you can run with this.

    Your very basic task control block needs a few things
    - a task state, see FreeRTOS task states and state transitions described for ideas....
  9. Thread: Task creations

    by Salem
    Replies
    7
    Views
    240

    It's all in the previous threads.

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

    by Salem
    Replies
    7
    Views
    240

    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...
  11. Replies
    5
    Views
    165

    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...
  12. Replies
    5
    Views
    165

    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...
  13. 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...
  14. Replies
    2
    Views
    126

    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;
  15. Replies
    2
    Views
    177

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

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

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

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

    > 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,...
  20. Replies
    4
    Views
    182

    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.
  21. Replies
    3
    Views
    198

    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?
  22. Thread: Username change

    by Salem
    Replies
    1
    Views
    269

    Send a PM to...

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

    by Salem
    Replies
    2
    Views
    225

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

    Also here -> coin smallest - C++ Forum
  24. Replies
    4
    Views
    264

    > 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 (...
  25. Replies
    17
    Views
    497

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