Search:

Type: Posts; User: nonpuz

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. I'll be sure to read up on what I'm missing in...

    I'll be sure to read up on what I'm missing in that department, I know I'm lacking in explicity.

    As for the rest of your post, thank you very much that was just the advice I was looking for.
  2. Templates, lambdas and overloaded operators

    What I'm trying to do is create a class for constructing an 'op tree' for parsing infix notation.

    I started with a base class that uses a map of lambdas to actually calculate the operations (since...
  3. Replies
    6
    Views
    6,078

    Edit your post and indent the code properly,...

    Edit your post and indent the code properly, there are sites online to do it, if you really can't do it yourself (your text editor should have autoindent based on language)
  4. Replies
    16
    Views
    1,017

    Several reasons: 1. You can't call fflush() on...

    Several reasons:
    1. You can't call fflush() on stdin that is undefined behavior
    2. You don't limit the size of the string you're reading in so thats a potential buffer overflow (use fgets() instead...
  5. Person * persons; Persons is a pointer. What...

    Person * persons;

    Persons is a pointer. What does it point to? In your case, an allocated piece of sequential memory big enough to fit 'TOTAL' Person objects.
    More simply persons points to a...
  6. Replies
    11
    Views
    811

    If you don't use a global pointer for the head of...

    If you don't use a global pointer for the head of your list, you have to pass the head of your list to your functions.

    Except there's a problem. Part of inserting into the list will require that...
  7. That is a typedef, that it's doing is linking the...

    That is a typedef, that it's doing is linking the name NodePtr to the type of struct node * (pointer to node object).

    Perhaps this will make it more clear:


    struct node{
    int num;
    struct...
  8. Replies
    12
    Views
    792

    I felt it was warranted in this situation because...

    I felt it was warranted in this situation because the OP shows a fundamental misunderstanding of how to accomplish the requested task and it has been over a day since the OP. But you're probably...
  9. Replies
    17
    Views
    1,087

    JSAMPARRAY rows_buffer; // Please dont hide...

    JSAMPARRAY rows_buffer; // Please dont hide arrays behind a type, or encapsulate it within a structure then
    ...
    rows_buffer = (*(*cDecompresInfo).mem->alloc_sarray) ((j_common_ptr)...
  10. Your solution is horrible. You didn't use ispunct...

    Your solution is horrible. You didn't use ispunct or isupper and your indentation is unacceptable.
  11. Replies
    12
    Views
    792

    Your second if condition doesn't work correctly....

    Your second if condition doesn't work correctly. The series of && only return a boolean result, not the value of all of the largest value amongst them. So really all your checking is, is each letter...
  12. Replies
    4
    Views
    716

    for (int counter = 0; counter < 10; ++counter) {...

    for (int counter = 0; counter < 10; ++counter) {
    if (counter == 0) /* Skip first line for some reason.. */
    continue; /* Still calls increment above */
    }

    int counter = 0;
    while...
  13. Replies
    51
    Views
    2,456

    Just curious... you mentioned a FILE * stream but...

    Just curious... you mentioned a FILE * stream but then keep talking about the FD API? Which is it? And I don't see any FILE * streams in your guiOpen() call, the only thing resembling file I/O is...
  14. strcmp( (a, "20") == 0 ) { /* Added spacing */ ...

    strcmp( (a, "20") == 0 ) { /* Added spacing */


    Do you see your mistake now?

    Secondly, please do NOT call fflush() on stdin, that results in undefined behavior. You can only call fflush() on...
  15. Replies
    3
    Views
    804

    I recommend using better indentation first off....

    I recommend using better indentation first off. Each inner block should have a level of indentation separate than it's enclosing braces.

    Secondly I also recommend using more spacing in your...
  16. I would suggest storing the strings in a separate...

    I would suggest storing the strings in a separate flat text file. Perhaps one file per language. You can store them sequentially then use IDs to reference each message. Then all you have to do is...
  17. Replies
    15
    Views
    1,398

    You do realize your algorithm fails if there are...

    You do realize your algorithm fails if there are no spaces in the string? IE you should always add 1 to your result, unless the string is entirely empty.
  18. Replies
    15
    Views
    1,398

    I'd have to disagree with you there. Mainly...

    I'd have to disagree with you there. Mainly because the standard idiom is not sizeof(type) but sizeof *ptr in which case it's not obvious that is a char pointer unless you omit that value.
    ...
  19. Replies
    15
    Views
    1,398

    I'd have to disagree with you there. Mainly...

    I'd have to disagree with you there. Mainly because the standard idiom is not sizeof(type) but sizeof *ptr in which case it's not obvious that is a char pointer unless you omit that value.
    ...
  20. Replies
    1
    Views
    5,093

    First off, the overall structure you have is...

    First off, the overall structure you have is somewhat decent. You need to breakdown the operations in AddBook a bit more though. You have a couple of repeated patterns. Look how much easier the code...
  21. Replies
    8
    Views
    569

    The while condition is executed for each...

    The while condition is executed for each iteration of the loop. That means getchar() is executed, which removes the \n from the buffer. Then the return value of getchar() (which has now removed that...
  22. Replies
    7
    Views
    608

    No I mean GUI programs. Look here for example:...

    No I mean GUI programs. Look here for example: Dialog Box Overview (Windows)
    These days .NET framework is really the more commonly used on Windows environments, which is actually somewhat portable...
  23. Your malloc call is totally wrong and is a...

    Your malloc call is totally wrong and is a perfect example of why you shouldn't cast the return of malloc(); not to mention the size calculation is wrong.
    Secondly, please do not post PICTURES of...
  24. Replies
    7
    Views
    608

    Technically you can create programs in Windows...

    Technically you can create programs in Windows using purely the windows API. Really the main thing GTK/wxWidget is providing you is a cross-platform GUI framework that has lots of builtin data...
  25. Replies
    8
    Views
    569

    First of all it should be: while ((ch =...

    First of all it should be:


    while ((ch = getchar()) != EOF && ch != '\n')
    ;


    Ie you need to check if you hit EOF or end of line (\n). The thing you're not understanding is that getchar()...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4