Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.16 seconds.

  1. > why the result of print statement for a.x...

    > why the result of print statement for a.x isn''t 1?
    Because you have a union and not a struct.

    With a union, only the last member you wrote is valid to read from.
  2. char r_getVersion[TRANSMIT_SIZE] =...

    char r_getVersion[TRANSMIT_SIZE] = {'E','R','_','C','M','D','#','T','3'};

    This should be in a source file.

    This should be in your header file.


    extern char r_getVersion[];
  3. I just love the innuendo that chopped liver over...

    I just love the innuendo that chopped liver over here made no contribution at all to the proceedings.
  4. > Please note that the realloc in the following...

    > Please note that the realloc in the following code for row_size does not occur since the file being read currently only has ~150 sentences.
    I'm glad you said, because it's broken to begin with.
    ...
  5. Replies
    3
    Views
    123

    How about adding yet more clarity, by saying -...

    How about adding yet more clarity, by saying
    - what processors you care about (more than just x86 doesn't say anything)
    - what compilers you care about
    - what operating systems you care about
    -...
  6. This is why indentation is so important. If you...

    This is why indentation is so important.
    If you have lousy indentation, it's too hard to track what belongs where.


    #include <stdio.h>
    #include <math.h>
    #include <cs50.h>
    int main(void)
    {
    ...
  7. You also can't use strcmp directly. The...

    You also can't use strcmp directly.

    The compare function gets pointers to pointers.
    So it needs a simple wrapper to do one level of dereferencing to get to something strcmp can use.


    ...
  8. Replies
    3
    Views
    123

    If it were that easy to do portably, the...

    If it were that easy to do portably, the standards committee wouldn't have bothered with the whole atomics thing to begin with.
  9. This works. int main(int argc, char...

    This works.


    int
    main(int argc, char *argv[])
    {
    char **t;
    char *s = "delta";

    t = bsearch(&s, tab, LEN(tab), sizeof *tab, (int(*)(const void *, const void *)) strcmp);
  10. Thread: Issue on coding

    by Salem
    Replies
    5
    Views
    121

    TBH, you copy/pasted your way to 100 extra lines,...

    TBH, you copy/pasted your way to 100 extra lines, only to discover what you did was wrong.



    #include <stdio.h>

    int main()
    {
    // Declaring the variables
    int GarmentType;
  11. For some corruption issues, you could try using a...

    For some corruption issues, you could try using a 'data breakpoint' in GDB.
  12. Replies
    2
    Views
    114

    You should probably have the volatile modifier,...

    You should probably have the volatile modifier, since from your description it appears that the variable is being changed asynchronously to your program.
  13. Thread: typedef struct

    by Salem
    Replies
    6
    Views
    131

    What's to explain? The second one just doesn't...

    What's to explain?

    The second one just doesn't compile.
  14. Thread: typedef struct

    by Salem
    Replies
    6
    Views
    131

    No..

    No..
  15. This isn't a free homework site. You need to...

    This isn't a free homework site.

    You need to at least make an effort towards your goal.
  16. Thread: typedef struct

    by Salem
    Replies
    6
    Views
    131

    Yes.

    Yes.
  17. Replies
    7
    Views
    154

    You make it complicated by trying to do it all...

    You make it complicated by trying to do it all yourself, and not making use of established libraries to do all the work for you.
  18. Replies
    3
    Views
    167

    Maybe things like void add(node **head, char...

    Maybe things like


    void add(node **head, char *name, int priority, int burst)
    {
    Task *taskNew = malloc(sizeof(Task));
    // int value=0;
    // __sync_fetch_and_add(&value,1);
    // no idea why...
  19. Replies
    7
    Views
    196

    Yeah, that's no answer. With the operator...

    Yeah, that's no answer.

    With the operator precedence you have, fCreate ends up as 0 or 1, neither of which are good things to pass to fclose.
    if (fCreate = ( fopen(e_F_Name, "r") == NULL ) )

    ...
  20. Replies
    7
    Views
    154

    Which OS? Which Compiler? Are you looking to...

    Which OS?
    Which Compiler?

    Are you looking to leverage all the goodies that your current platform provides.
    PlaySound function (Windows) | Microsoft Docs

    Or are you going really low level and...
  21. Replies
    3
    Views
    167

    Your 'struct node head' thing needs to travel...

    Your 'struct node head' thing needs to travel between all the functions.

    All your add() function does is create an empty list, append one task to it, then throw the whole lot away with a memory...
  22. Replies
    7
    Views
    175

    So do you get any actual useful information out...

    So do you get any actual useful information out of codewars - you know, more than "it doesn't work"?

    Also, I'm guessing "abc#d##c" isn't the actual (or only) string being tested.
    You need to take...
  23. Replies
    7
    Views
    175

    Do you want the actual string "ac", or just...

    Do you want the actual string "ac", or just something that prints as "ac" because it's got backspace characters in it.

    Such as "abc\bd\b\bc"
  24. Replies
    2
    Views
    174

    Use two loops. while (...

    Use two loops.


    while ( fgets(buff,SIZE,dosya) ) {
    if ( buff[0] == 'E' ) break;
    sscanf(buff," %f %f %f %f %f %f ",&musteri.id[i],&musteri.x1[i],&musteri.x2[i],
    ...
  25. Replies
    15
    Views
    300

    Well the multiply defined things are because your...

    Well the multiply defined things are because your wrath-utils.h should really be called wrath-utils.c, because it contains actual code.

    #including definitions only works if you include it once in...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4