Search:

Type: Posts; User: |deep|

Search: Search took 0.01 seconds.

  1. Thread: Quicksort

    by |deep|
    Replies
    1
    Views
    2,575

    Quicksort

    Hi, i'm trying to implement a nonrecursive quicksort. I have written this code but it doesn't work. It simply doesn't sort the array. Can you give same advice?


    void quicksort_it(int...
  2. Replies
    5
    Views
    1,845

    He means that if he ever writes the code of a...

    He means that if he ever writes the code of a operation system what kind of a compiler he will use to compile it.

    The answer is:
    When you write one, you'll probably know.
  3. Replies
    6
    Views
    1,204

    You should go and learn some data...

    You should go and learn some data structures(especially linked lists and binary trees) to practice a lot of recursion problems.

    Some very good problems are in Stanford computer science library...
  4. All of the books are for intermediate...

    All of the books are for intermediate programmers. If you're new to c++, then get a more basic book. Deitel is fine, but if you don't have any programming background, then go get some 21 days stuff...
  5. Thread: allegro

    by |deep|
    Replies
    7
    Views
    1,429

    allegro

    I finally got allegro installed in my computer. I tried it for MSVC++ and Borland 5.0 but there were always errors like unresolved external, missing '}' in allegro.h (??) etc. I got it now working...
  6. Replies
    12
    Views
    1,208

    Try system("cls") #include ...

    Try system("cls")


    #include <iostream>
    #include <conio.h>
    using namespace std;
    int main(){

    int x = 0;
    int y = 0;
  7. Replies
    12
    Views
    1,208

    Is the clrscr() function not working? If the...

    Is the clrscr() function not working? If the problem is that, it can depend on your compiler. (Maybe it's not supporting clrscr())
    Indicate your error(s) so others can understand the problem.
  8. Replies
    2
    Views
    1,674

    You're right. The error is on these pointers. I...

    You're right. The error is on these pointers. I created an additional struct type and replace string with char*:


    struct ArrayNode
    {
    bool IsQuestion;
    char *info;
    }

    and I used natural...
  9. Thread: infinity

    by |deep|
    Replies
    10
    Views
    4,974

    Yeah, you can use the approach strategy above....

    Yeah, you can use the approach strategy above. it's a very clever idea. Construct a class like above but also include a member function that always sets the data included in the class higher than...
  10. Thread: infinity

    by |deep|
    Replies
    10
    Views
    4,974

    You can flag a value so that it presents positive...

    You can flag a value so that it presents positive infinity, for example if you deal with only positive numbers, then -1 can be positive infinity.
  11. Replies
    6
    Views
    1,280

    read faq.

    read faq.
  12. Replies
    2
    Views
    1,674

    Saving array of structs to file

    My program deals with the following structs:


    struct NodeType
    {
    bool IsQuestion;
    string info;
    NodeType* right;
    NodeType* left;
    };
  13. Thread: compiling?????

    by |deep|
    Replies
    8
    Views
    1,203

    ok now. Go to start. click run. type cmd in it...

    ok now. Go to start. click run. type cmd in it
    then type c:\borland\bcc55\bin, then type bcc32 blahblah
    by the way,you must also save your code into this folder.

    There is one more thing, you set...
  14. Thread: compiling?????

    by |deep|
    Replies
    8
    Views
    1,203

    I think you're using Borland c++ compiler 5.11...

    I think you're using Borland c++ compiler 5.11 (the free one).
    then open a command window, go to the borland\bcc55\bin directory and type it there
    command window = dos window
    ok?
  15. Replies
    11
    Views
    1,456

    If you have some input like 00|01|02 then you...

    If you have some input like
    00|01|02 then you cannot use it. Instead take the whole thing into an array and then separate the integers.
    [CODE]
    int main()
    {
    ifstream inFile;...
  16. Thread: compiling?????

    by |deep|
    Replies
    8
    Views
    1,203

    Save your code as blahblah.cpp in your...

    Save your code as blahblah.cpp in your borland\bcc55\bin directory and type bcc32 blahblah.
  17. Replies
    3
    Views
    1,440

    Actually there is a more efficient and short way...

    Actually there is a more efficient and short way to do this: If the numbers in response array range from 1 to 9, then :


    for(int i=0;i<responsesize;i++)
    frequency[response[i]]++;

    Then...
  18. Thread: array problem

    by |deep|
    Replies
    3
    Views
    912

    As fart as I know, there isn't a way to do that...

    As fart as I know, there isn't a way to do that because the memory for this array is located at compile time if you do not use dynamic allocation with new.

    But you can flag the elements indicating...
  19. No, but you can do that using preprocessor...

    No, but you can do that using preprocessor statements like


    //This prevents const.h to be twice included
    #ifndef _CONST_H_INCLUDED
    #include <const.h>
    #endif
  20. Replies
    2
    Views
    1,585

    You are declaring your function void...

    You are declaring your function


    void SetBoard(char board[][79], SHIP* player);

    before you declare your struct SHIP. Correct code is:


    #include <iostream.h>
    #include <conio.h>
  21. Replies
    4
    Views
    909

    There is another error in your code: This: ...

    There is another error in your code:
    This:


    for(int x=0;x<100;x+1)

    must be like this:


    for(int x=0;x<100;x++)
Results 1 to 21 of 21