Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.34 seconds.

  1. Replies
    4
    Views
    566

    What do you think 'jmp int_bottom' does?

    What do you think 'jmp int_bottom' does?
  2. Replies
    4
    Views
    566

    They're assembler macros. .macro...

    They're assembler macros.


    .macro HandleException num
    .global _ZN16InterruptManager19HandleException\num\()Ev
    _ZN16InterruptManager19HandleException\num\()Ev:
    movb $\num, (interruptnumber)...
  3. &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT)...

    &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT) creates a temporary object.

    The main problem with these is you've got no control over the lifetime of the temporary, which is why it now...
  4. They are respectively the copy constructor and...

    They are respectively the copy constructor and assignment operator.
    14.14 — Introduction to the copy constructor – Learn C++
    22.3 — Move constructors and move assignment – Learn C++
    21.12 —...
  5. Replies
    1
    Views
    1,637

    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
    ...
  6. 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
  7. > 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...
  8. Replies
    12
    Views
    4,010

    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.
  9. Replies
    24
    Views
    6,645

    > 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]
    ...
  10. Replies
    12
    Views
    4,010

    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 =...
  11. Replies
    12
    Views
    4,010

    > 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...
  12. Replies
    12
    Views
    4,010

    > 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...
  13. 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.
  14. 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...
  15. 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
  16. Replies
    8
    Views
    3,713

    > 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...
  17. Replies
    8
    Views
    3,713

    > 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...
  18. > 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.
  19. Replies
    8
    Views
    3,713

    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>...
  20. Replies
    3
    Views
    2,948

    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 ==...
  21. Replies
    4
    Views
    2,641

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

    You should also read the manual page for select() while you're at it.
  22. 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;
  23. Show us what you have so far.

    Show us what you have so far.
  24. Replies
    5
    Views
    5,297

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