Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    3
    Views
    189

    It's impossible to verify your formulas based on...

    It's impossible to verify your formulas based on your fuzzy pictures taken from your phone.


    First off, remove useless fluff


    baz.cpp: In function ‘int main()’:
    baz.cpp:16:10: warning:...
  2. Replies
    9
    Views
    233

    You have a lot of direct and indirect recursion...

    You have a lot of direct and indirect recursion of task_switcher().

    Multiple global variables called 'lock', 'count' and 'str' doesn't help with readability.

    Here's my take on your two tasks.
    ...
  3. Replies
    5
    Views
    128

    You seem to have forgotten most of what you...

    You seem to have forgotten most of what you learnt.
    Error: assignment of i_value in read-only object

    Study post #21 in detail.
  4. Replies
    4
    Views
    113

    Your program was screwed from the moment it did...

    Your program was screwed from the moment it did
    strcat(strA,strB);

    There's no point trying to rationalise any right/wrong/weird behaviour beyond that point.
    The code is broken and needs to be...
  5. Replies
    5
    Views
    128

    You're ignoring things. $ gcc -g -Wall foo.c...

    You're ignoring things.


    $ gcc -g -Wall foo.c
    foo.c: In function ‘add_end’:
    foo.c:43:5: warning: ‘return’ with no value, in function returning non-void
    return;
    ^
    foo.c: In function...
  6. > while( iter < maxIter or ea > es ) Perhaps...

    > while( iter < maxIter or ea > es )
    Perhaps you wanted 'and' rather than 'or'

    Remember that 'and(&&)' and 'or(||)' are short-circuit evaluated.
    If the left of || is true, the right isn't even...
  7. Replies
    4
    Views
    113

    > char strA[] = "OPC"; This tells the...

    > char strA[] = "OPC";
    This tells the compiler to count the characters between the "" and make an array of that size.
    So what you really have is strA[4] in this case.

    > char strB[20] =...
  8. Replies
    9
    Views
    233

    Is data_print really an ISR capable of only...

    Is data_print really an ISR capable of only printing one character at a time to some external device?
  9. Replies
    9
    Views
    233

    Well no, you can't assign the contents of what a...

    Well no, you can't assign the contents of what a pointer points to to an array.

    That's why we have functions like strcpy.

    You should find a way of solving your question without so many messy...
  10. Replies
    5
    Views
    298

    > 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...
  11. Replies
    4
    Views
    139

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

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

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

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

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

    > 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.
  15. Replies
    13
    Views
    322

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

    You're not swapping anything at line 17.

    Swaps typically take 3 lines of code.
  16. Replies
    3
    Views
    153

    Have you tried pressing 9 and then enter?

    Have you tried pressing 9 and then enter?
  17. Replies
    6
    Views
    377

    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.
  18. Replies
    12
    Views
    359

    > 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...
  19. Replies
    3
    Views
    197

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

    by Salem
    Replies
    3
    Views
    147

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

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

    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.
  22. Replies
    35
    Views
    545

    > 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,...
  23. Replies
    12
    Views
    359

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