Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.59 seconds.

  1. Replies
    1
    Views
    1,004

    GdkPixbuf.Pixbuf.new_from_bytes...

    GdkPixbuf.Pixbuf.new_from_bytes


    You need to filter your png files through say imagemagik to get just the raw RGB data.
    A close example:
    imagemagick convert png 16 bit to raw - Stack Overflow
    ...
  2. Try all: main test_segment test_segment:...

    Try


    all: main test_segment

    test_segment: test_segment.c segment.c
    gcc -Wall -o test_segment test_segment.c segment.c

    main : main.c segment.c
    gcc -Wall -o main main.c segment.c
  3. > so basically the function in "segment.h" is not...

    > so basically the function in "segment.h" is not found
    It was found, otherwise you would have gotten a different error message.

    Your error is from the linker, not the compiler.

    segment.h...
  4. Replies
    12
    Views
    3,209

    I expect there is some collusion between the...

    I expect there is some collusion between the compiler and assembler that automatically infers certain operations when compiling 64-bit code.
  5. Replies
    24
    Views
    5,122

    > printf("Location: %lu\n", (argv[1], "#"));...

    > printf("Location: %lu\n", (argv[1], "#"));
    What!?



    $ gcc -Wall bar.c
    bar.c: In function ‘main’:
    bar.c:6:39: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    ...
  6. Replies
    12
    Views
    3,209

    Even though it's apparently only loading the...

    Even though it's apparently only loading the lower 32-bits using edi, it does seem like it does get sign-extended to 64-bits.



    Breakpoint 1, main () at bar.c:13
    13 char *name =...
  7. Replies
    12
    Views
    3,209

    > warning: Memory pointed to by 'name' is freed...

    > warning: Memory pointed to by 'name' is freed twice. [doubleFree]
    You could try tagging the function as __attribute__((__noreturn__)), so the tool knows that it never returns.

    But it should...
  8. Replies
    12
    Views
    3,209

    > Is it a good practice to free memory before...

    > Is it a good practice to free memory before exiting the program?
    Yes in general.

    > I've read many places online that since modern operating systems reclaim all resources before exiting, there's...
  9. It's all very vague. We have an expected...

    It's all very vague.

    We have an expected input, but no idea about the output.
  10. Like any of these? $ xsel | fold -w 50...

    Like any of these?


    $ xsel | fold -w 50
    Paragraphs are the building blocks of papers. Many
    students define paragraphs in terms of length: a
    paragraph is a group of at least five sentences, a...
  11. So what separates one field from another? A...

    So what separates one field from another?

    A comma
    A tab
    The fact that it's exactly 120 chars wide
  12. Replies
    8
    Views
    3,618

    > even i tried gcc -o main.c add.c Nice, you...

    > even i tried gcc -o main.c add.c
    Nice, you just trashed your source file with a mis-guided -o option.

    > When I ran the command gcc main.c add.c I received an error message
    Right, and I'm...
  13. Replies
    8
    Views
    3,618

    > I ran your code and got error because you are...

    > I ran your code and got error because you are using main keyword in two source file
    That's because you're incapable of following instructions.

    > gcc -o hello main.c add.c add_test.c
    Read my...
  14. > int c = getchar(); > while((c = getchar()) !=...

    > int c = getchar();
    > while((c = getchar()) != EOF)
    There are two calls to getchar before you get to your first putchar.
  15. Replies
    8
    Views
    3,618

    First you would separate functions out so they...

    First you would separate functions out so they are testable to begin with.
    A ball-of-mud main.c with everything in it doesn't lend itself to being tested.



    // main.c
    #include <stdio.h>...
  16. Replies
    3
    Views
    2,876

    First of all, it's not backspace " " is space...

    First of all, it's not backspace
    " " is space (cursor moves right(*))
    "\b" is backspace (cursor moves left(*))

    Try this


    if(decision == 'y')
    showfile();
    else if(decision ==...
  17. Replies
    4
    Views
    2,593

    You should also read the manual page for select()...

    You should also read the manual page for select() while you're at it.
  18. How to add counters int divide(int a) { ...

    How to add counters


    int divide(int a)
    {
    numcalls++;
    if (a > 1) {
    return divide (a/2);
    }
    return a;
  19. Show us what you have so far.

    Show us what you have so far.
  20. Replies
    5
    Views
    4,996

    qsort, qsort_s - cppreference.com...

    qsort, qsort_s - cppreference.com is a prime example right there in the standard library.

    GUI's are often implemented using callback functions - which are function pointers.

    Threads are created...
  21. Write recursive and non-recursive versions of...

    Write recursive and non-recursive versions of some functions and count for yourself.

    You want to understand - write some code!
  22. There's no reason to avoid it per se, it just...

    There's no reason to avoid it per se, it just comes with a few health warnings - like the aforementioned stack overflow potential.

    Anything you can do with recursion, you can do with a for loop...
  23. > the recursion part how it's done on assembly...

    > the recursion part how it's done on assembly behind.
    Exactly the same way one function would call another.

    Nothing changes except for the name of the called function.

    For recursive...
  24. Replies
    6
    Views
    2,906

    > why it can't be like Why would you think that?...

    > why it can't be like
    Why would you think that?

    You can't just call a function randomly from a line like that.

    It has to be inside a function definition.

    As it stands, it looks like some...
  25. Replies
    6
    Views
    2,906

    You're on windows. Try calling it hello.exe

    You're on windows.
    Try calling it hello.exe
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4