Search:

Type: Posts; User: aerian

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,427

    Hmm, it seems to be good now. More or less, it's...

    Hmm, it seems to be good now. More or less, it's what I intended :)
    At least it is easier to read for me. Though, my knowledge of STL is reduced to it's name and to some intuition, what else can be...
  2. Replies
    5
    Views
    906

    If you declare a class member with keyword...

    If you declare a class member with keyword static, it will be common to all objects in that class. Maybe you can use it in some way, for example to count instances and to assign different number to...
  3. Replies
    2
    Views
    1,051

    Hmm.. I was too hungry to think about the code...

    Hmm.. I was too hungry to think about the code last time.

    Use indentation, so others (and also you) can easily determine where the while loop ends.

    The if part of else..if (else if(arrive ==...
  4. Replies
    2
    Views
    1,051

    Note for administrator: what are doing smilies...

    Note for administrator: what are doing smilies inside code tags? :)

    You should check whether the queue is empty before dequeueing, or do checking in dequeue() function.
  5. Replies
    41
    Views
    3,558

    Maybe what is ANSI C++, what is not and what it...

    Maybe what is ANSI C++, what is not and what it is good for.

    And something about functions: inline, virtual, pure virtual and const functions, mainly the last ones.

    Comparing float variables...
  6. Replies
    3
    Views
    1,346

    Use indentation, so others will know what you...

    Use indentation, so others will know what you mean.
    I think that problem is in curly brackets {} in CalculateTime() function. Anyway, that function seems strange. Why to use a loop, if you can do...
  7. Replies
    3
    Views
    1,009

    We will try to help, but please consider that...

    We will try to help, but please consider that there is at least one program or post of that kind every day and it seems to me kind of boring, write still the same. Try FAQ or some tutorial first,...
  8. Thread: corecursive

    by aerian
    Replies
    5
    Views
    1,219

    Ah, I got some idea :) The count_alph() should...

    Ah, I got some idea :)

    The count_alph() should count alphabetical characters, and on the first occurence of digit it should call sum_digits(), but not with initial string, but only with rest of...
  9. Thread: corecursive

    by aerian
    Replies
    5
    Views
    1,219

    Still I cannot figure out what should the...

    Still I cannot figure out what should the functions do... Why should they call each other? :confused:

    Some bugs I commented in my previous post (condition in second function, ...).

    Try it on...
  10. Replies
    6
    Views
    1,427

    I would use for loops instead of while, because...

    I would use for loops instead of while, because if you know the number of loops, it is better readable than some ++i and ++pass statements.

    And you can think about contain of your data structures....
  11. Replies
    3
    Views
    1,001

    By bloodshed you mean Dev-C++? If you are...

    By bloodshed you mean Dev-C++?
    If you are programming console application under DOS/maybe Win, you can use conio.h and get some colored text. I don't remember details... it was too long ago.
  12. Thread: corecursive

    by aerian
    Replies
    5
    Views
    1,219

    It seems really queer to me... First, why you...

    It seems really queer to me...
    First, why you are using two functions, even recursive ones, for such a simple task, which can be done in single loop?

    And that assignment
    *alph_sum=...
  13. Thread: segment fault?

    by aerian
    Replies
    4
    Views
    1,607

    If you allocate something with new[], then you...

    If you allocate something with new[], then you should frre it with delete [] operator. If you free the memory with just delete, it will probably turn wrong, for example memory will be really...
  14. Replies
    6
    Views
    1,921

    First you should decide what is a word and what...

    First you should decide what is a word and what is not. Is '&*(^*' a word or not? Usually words are separated by whitespace characters, thus ' ', '\t' and '\n'.

    For average number of chars in...
  15. Replies
    6
    Views
    1,921

    Yes. Only you need to find it :) I would read...

    Yes. Only you need to find it :)

    I would read the input file by characters.
    It is a bit easier to decide what element of res[] should be
    incremented, the array res[] can have size of 256 chars...
  16. Replies
    15
    Views
    2,952

    If the string is overflowed, it's too late in...

    If the string is overflowed, it's too late in most cases :)

    That is generally not a good idea. By declaration char str[10]; you will get an array of characters, also the memory for them, in your...
  17. Replies
    33
    Views
    6,244

    What does ineffable mean?? My stupid dictionary...

    What does ineffable mean?? My stupid dictionary doesn't have anything to that...
  18. Replies
    62
    Views
    12,250

    And while speaking about books, don't you know...

    And while speaking about books, don't you know about some free ones? To download at least... because I doubt that someone will send me book, even to my home, for free :)

    I like George Orwell, JRR...
  19. Replies
    9
    Views
    1,664

    Few days ago I have found another way by reading...

    Few days ago I have found another way by reading Linux manpage: you can use function strtol(), which will also report for what reason the conversion failed (if it failed). See man strtol for better...
  20. Thread: make file

    by aerian
    Replies
    6
    Views
    1,249

    http://www.gnu.org/manual/make-3.80/make.html or...

    http://www.gnu.org/manual/make-3.80/make.html or
    http://www.gnu.org/manual/make-3.80/html_chapter/make_toc.html
  21. Replies
    5
    Views
    3,391

    Compiling with math library is important, so use...

    Compiling with math library is important, so use the -lm.
    Otherwise it will give some unpredictable result, I have tried it once (by mistake) and I was totally surprised what is the program doing....
  22. Replies
    4
    Views
    1,772

    Here is my view of the problem: For tree...

    Here is my view of the problem:

    For tree without any subtrees the result is one, because such a tree is a leaf. It's easy to find out whether the has some subtrees or not, for example


    if...
  23. Replies
    10
    Views
    1,627

    If I understand what do you want, you can print...

    If I understand what do you want, you can print that string to a string :) using sprintf, which will print also substitution for %s and then use strlen() on the result.
Results 1 to 23 of 23