Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.26 seconds; generated 7 minute(s) ago.

  1. Replies
    3
    Views
    81

    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
    -...
  2. 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)
    {
    ...
  3. 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.


    ...
  4. Replies
    3
    Views
    81

    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.
  5. 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);
  6. Thread: Issue on coding

    by Salem
    Replies
    5
    Views
    96

    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;
  7. For some corruption issues, you could try using a...

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

    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.
  9. Thread: typedef struct

    by Salem
    Replies
    6
    Views
    116

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

    What's to explain?

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

    by Salem
    Replies
    6
    Views
    116

    No..

    No..
  11. 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.
  12. Thread: typedef struct

    by Salem
    Replies
    6
    Views
    116

    Yes.

    Yes.
  13. Replies
    7
    Views
    144

    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.
  14. Replies
    3
    Views
    155

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

    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 ) )

    ...
  16. Replies
    7
    Views
    144

    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...
  17. Replies
    3
    Views
    155

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

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

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

    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],
    ...
  21. Replies
    15
    Views
    292

    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...
  22. Replies
    15
    Views
    292

    Fix looks good. Try it and see what happens. ...

    Fix looks good.
    Try it and see what happens.

    > //#include "wrath-utils.h"
    Was probably not necessary to do this.
  23. Replies
    15
    Views
    292

    You definitely need to find out where safe_malloc...

    You definitely need to find out where safe_malloc is prototyped, and include the appropriate header.

    Your machine has 64-bit addresses.
    Without a prototype, C thinks safe_malloc returns int -...
  24. Replies
    5
    Views
    190

    Like I said in your previous thread. Fix your...

    Like I said in your previous thread.

    Fix your warnings.


    $ gcc -Wall bar.c
    bar.c: In function ‘main’:
    bar.c:17:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has...
  25. Replies
    8
    Views
    232

    Cross-posted how get the JPG image size?...

    Cross-posted
    how get the JPG image size?
    how read the GIF and JPG image size? - C++ Forum
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4