Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.11 seconds.

  1. Replies
    4
    Views
    117

    > Does anyone know the calculation to do that? ...

    > Does anyone know the calculation to do that?
    Pencil, paper - and a bit of geometry.

    > I can calculate how to center a window on the desktop screen.
    Try doing the same, but introduce a left=0...
  2. Replies
    4
    Views
    95

    > float red2 = image[i][j + 1].rgbtRed; All...

    > float red2 = image[i][j + 1].rgbtRed;
    All these +1 and +2 are going to overflow your array bounds at the limits of your loops.



    float red = 0;
    float green = 0;
    float blue = 0;
    for ( int x...
  3. Replies
    2
    Views
    157

    Scroll down to the "Show threads from the..."...

    Scroll down to the "Show threads from the..." drop-down box.
  4. Replies
    13
    Views
    251

    > return (*(int *)ap > *(int *)bp) - ( *(int *)ap...

    > return (*(int *)ap > *(int *)bp) - ( *(int *)ap < *(int *)bp );
    Unnecessarily terse, and contains a bug.
    Try again.
  5. Replies
    13
    Views
    251

    > printf("%d", list[j]); Move it into the i...

    > printf("%d", list[j]);
    Move it into the i loop, and print subscript i instead.

    Also, you don't need an array of temp, just one.
  6. Replies
    13
    Views
    251

    You're not swapping anything at line 17. Swaps...

    You're not swapping anything at line 17.

    Swaps typically take 3 lines of code.
  7. Replies
    3
    Views
    128

    Have you tried pressing 9 and then enter?

    Have you tried pressing 9 and then enter?
  8. Replies
    6
    Views
    333

    So instead of learning how to solve a problem,...

    So instead of learning how to solve a problem, the OP has learnt that eventually, some schmuck will do their work for them.
  9. Replies
    12
    Views
    335

    > width = bmih.biWidth; if (width%4 != 0) width...

    > width = bmih.biWidth; if (width%4 != 0) width += (4-width%4);
    This is wrong.

    If you have a width of 9 pixels, and 3 bytes per pixel, you have 27 bytes of pixel data per row.

    It is the...
  10. Replies
    3
    Views
    176

    > In order to run this program, the following is...

    > In order to run this program, the following is done
    > ./justify <quote
    TBH, I would add a second option to justify, namely to open the file supplied as a command line argument.

    As in...
  11. Thread: Prime Factor

    by Salem
    Replies
    3
    Views
    135

    Cross-posted here -> Prime Factor - C And C++ |...

    Cross-posted here -> Prime Factor - C And C++ | Dream.In.Code
  12. Replies
    6
    Views
    333

    You start by breaking the problem down into...

    You start by breaking the problem down into simpler problems.

    Like for example, by trying to draw a cross and then an empty diamond


    ....0.....
    ....0.....
    ....0.....
    ....0.....
    000000000.
  13. Replies
    35
    Views
    492

    > adds another point of entry via symlnk or...

    > adds another point of entry via symlnk or whatever it was for malicious software, the fewer points the better
    This is just BS and FUD.

    What you describe only works for dynamic link libraries,...
  14. Replies
    12
    Views
    335

    > unsigned char ee_image[2048][2048]; Another...

    > unsigned char ee_image[2048][2048];
    Another thing to watch out for is your stack usage.

    Your familiar OS usually restricts stack usage to between 1MB and 8MB.
    You just burned 4MB in a single...
  15. Like this? OK, so when I change the 6 to 16...

    Like this?


    OK, so when I change the 6 to 16 in this
    > m.second = str.substr(index, 16);

    I get


    $ g++ -std=c++11 foo.cpp
  16. When you delete the last record, you also need to...

    When you delete the last record, you also need to do
    current->record_list = NULL;
  17. Well at the moment, add_record doesn't add/remove...

    Well at the moment, add_record doesn't add/remove any of the nodes within the keylist.
    Adding a record to one of the nodes doesn't change the overall arrangement of nodes, so there is no need to...
  18. Replies
    14
    Views
    408

    Maybe make clean also a phony target.

    Maybe make clean also a phony target.
  19. Replies
    14
    Views
    408

    > cc -fPIE -shared -Wall -Wextra -o alu_bit.o...

    > cc -fPIE -shared -Wall -Wextra -o alu_bit.o alu_bit.c
    All your .c.o rules need to pass the -c command line option to cc.

    You compile (only) all the .c files into .o files in the first instance....
  20. Replies
    6
    Views
    468

    You need to study how printf and scanf work. ...

    You need to study how printf and scanf work.


    $ gcc -Wall foo.c
    foo.c: In function ‘initStructs’:
    foo.c:47:25: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type...
  21. Maybe say which variant you mean. std::cout...

    Maybe say which variant you mean.


    std::cout << "Content of var is: " + std::to_string(std::get<int>(var));
  22. c++ - How to enable C++17 compiling in Visual...

    c++ - How to enable C++17 compiling in Visual Studio? - Stack Overflow

    Or
    g++ -std=c++17 prog.cpp
  23. Lookup the strstr() function.

    Lookup the strstr() function.
  24. std::variant - cppreference.com...

    std::variant - cppreference.com
    You need to tell your compiler to compile in C++17 mode.
  25. You could do something like int count = 0,...

    You could do something like


    int count = 0, value, sum = 0;
    while ( fscanf(p, "%d", &value ) == 1 ) {
    sum += value;
    count++;
    }
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4