Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.43 seconds.

  1. Replies
    3
    Views
    223

    I moved it because it wasn't a C question.

    I moved it because it wasn't a C question.
  2. Replies
    1
    Views
    191

    First step, add some debug print (or use a...

    First step, add some debug print (or use a debugger) to get some visual indication of what's going on.


    int sort_ascending(int a[],int size,int *loc_ptr)
    {
    int x,temp,pass;

    ...
  3. Replies
    9
    Views
    332

    Please attach your text file as text, not a...

    Please attach your text file as text, not a broken inline picture.

    What is 'buffer' initialised to prior to calling malloc?

    What stops 'o' from running past the end of allocated space?
  4. Replies
    5
    Views
    315

    The symbol is resolved by libX11.so $ nm -D...

    The symbol is resolved by libX11.so


    $ nm -D /usr/lib/x86_64-linux-gnu/libXext.so | grep XOpenDisplay
    $ nm -D /usr/lib/x86_64-linux-gnu/libX11.so | grep XOpenDisplay
    000000000002d370 T...
  5. Replies
    6
    Views
    343

    The code is getting uglier, but is it getting any...

    The code is getting uglier, but is it getting any quicker?
  6. Replies
    2
    Views
    235

    PlaySound function (Windows) | Microsoft Docs...

    PlaySound function (Windows) | Microsoft Docs
    1. Trying to pass 4 parameters to a function expecting only 3 should have at least got you a warning message.
    It should be an error.

    The last 'two'...
  7. You could do the double fork. if ( fork() ==...

    You could do the double fork.


    if ( fork() == 0 ) {
    if ( fork() == 0 ) {
    execvp(*arg, arg);
    } else {
    _exit(0);
    }
    }
  8. Replies
    7
    Views
    363

    Use %p if you want to print a pointer.

    Use %p if you want to print a pointer.
  9. Replies
    9
    Views
    571

    > In what respect does fgets() differ from...

    > In what respect does fgets() differ from gets()?
    fgets won't overrun the end of the buffer you supply, so long as you're honest about the size of the buffer.

    > what is the size of the said...
  10. Replies
    6
    Views
    343

    > Does the modification make any difference ?...

    > Does the modification make any difference ?
    Why haven't you tested it?

    > If so is that modification more efficient ?
    Why haven't you tested it?

    Here are some test cases
    - the...
  11. Thread: matrix Problem

    by Salem
    Replies
    1
    Views
    234

    https://cboard.cprogramming.com/announcement.php?a...

    https://cboard.cprogramming.com/announcement.php?a=39
    Make an effort.
    Just dumping your assignment isn't good enough.
  12. https://cboard.cprogramming.com/announcement.php?a...

    https://cboard.cprogramming.com/announcement.php?a=39
    Make an effort.
    Just dumping your assignment isn't good enough.
  13. Replies
    25
    Views
    1,213

    Your indentation is STILL a mess. You don't call...

    Your indentation is STILL a mess.
    You don't call your function from main, so - really - nothing happens.
  14. Replies
    2
    Views
    361

    > I have an exe project with a large struct in...

    > I have an exe project with a large struct in it.
    What constitutes 'large'?
    1KB
    4KB
    64KB
    1MB
    ?

    What happens in the DLL if it dereferences the pointer to supposedly read a garbage value,...
  15. Just delete the call to wait(NULL);

    Just delete the call to wait(NULL);
  16. Replies
    2
    Views
    245

    Maybe you can use %s instead of %c in the last...

    Maybe you can use %s instead of %c in the last case.

    Or learn to use your compiler.


    $ gcc -Wall foo.c
    foo.c: In function ‘main’:
    foo.c:8:12: warning: format ‘%c’ expects argument of type...
  17. Replies
    25
    Views
    1,213

    > I have removed the const input and below is my...

    > I have removed the const input and below is my code. please check it.
    How about you indent it properly first.
    It's a dogs breakfast.
  18. Replies
    3
    Views
    395

    > cur_data is a global variable Ugh, why isn't...

    > cur_data is a global variable
    Ugh, why isn't it a parameter?



    static void dump(void *cur_data, const char *prefix, size_t size)
    {
    switch(size){
    case sizeof(struct A): {
    ...
  19. Replies
    15
    Views
    746

    Look at your picture in post #9 if (...

    Look at your picture in post #9



    if ( List->Head == NULL ) {
    // update head and tail to point to the node you created
    } else {
    // add the node to where tail points, and adjust tail.
    }
  20. What is the major difference between C and C++ at...

    What is the major difference between C and C++ at DuckDuckGo

    And no, you're not going to understand C++ just by knowing the differences (of which there are many).
  21. Replies
    1
    Views
    323

    Also here -> Building A Online Compiler - C++...

    Also here -> Building A Online Compiler - C++ Forum
    With spam.
  22. Replies
    1
    Views
    287

    Even a simple search would tell you the answer....

    Even a simple search would tell you the answer.
    C keywords - cppreference.com

    But this is the 2nd time I've deleted your spammy links.
    It will be your last.
  23. Replies
    1
    Views
    302

    First off, indent...

    First off, indent your code.


    #include<stdio.h>
    #include<math.h>

    int inrange(int, int, int, int);
    int cubesum(int, int, int, int);
    int avsqrsum(int, int, int, int);
    int squaresum(int, int,...
  24. Replies
    4
    Views
    389

    Probably the easiest thing to do is to use fgets...

    Probably the easiest thing to do is to use fgets instead of fscanf


    char buff[BUFSIZ];
    while ( fgets(buff, BUFSIZ, f) ) {
    if(sscanf(buff, "%f,%f,%f,%f", &x[n][0], &x[n][1], &x[n][2],...
  25. Replies
    9
    Views
    646

    > I completely understand pointer, dynamic memory...

    > I completely understand pointer, dynamic memory allocation and structure.
    But the list you create in post #4 contains a garbage node at the end of your list.
    If you want to have a more complete...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4