Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.19 seconds.

  1. Replies
    4
    Views
    59

    > 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...
  2. Replies
    2
    Views
    119

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

    Scroll down to the "Show threads from the..." drop-down box.
  3. Replies
    12
    Views
    216

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

    > return (*(int *)ap > *(int *)bp) - ( *(int *)ap < *(int *)bp );
    Unnecessarily terse, and contains a bug.
    Try again.
  4. Replies
    12
    Views
    216

    > 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.
  5. Replies
    12
    Views
    216

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

    You're not swapping anything at line 17.

    Swaps typically take 3 lines of code.
  6. Replies
    3
    Views
    119

    Have you tried pressing 9 and then enter?

    Have you tried pressing 9 and then enter?
  7. Replies
    6
    Views
    318

    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.
  8. Replies
    12
    Views
    327

    > 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...
  9. Replies
    3
    Views
    168

    > 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...
  10. Thread: Prime Factor

    by Salem
    Replies
    3
    Views
    133

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

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

    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.
  12. Replies
    35
    Views
    487

    > 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,...
  13. Replies
    12
    Views
    327

    > 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...
  14. 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
  15. 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;
  16. 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...
  17. Replies
    14
    Views
    406

    Maybe make clean also a phony target.

    Maybe make clean also a phony target.
  18. Replies
    14
    Views
    406

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

    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...
  20. 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));
  21. 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
  22. Lookup the strstr() function.

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

    std::variant - cppreference.com
    You need to tell your compiler to compile in C++17 mode.
  24. 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++;
    }
  25. Thread: Run a program

    by Salem
    Replies
    3
    Views
    242

    What are your definitions of "program" and...

    What are your definitions of "program" and "application"?

    To me, they're the same thing.

    Do you mean application = program + glossy-point-and-click-menus-and-pretty-pictures ?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4