Search:

Type: Posts; User: Bnchs400

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    3,889

    I have modified my code to declare the struct as...

    I have modified my code to declare the struct as a class instead.

    so now I have:



    class AvlNode
    {
    int element;
    AvlNode *left;
  2. Replies
    7
    Views
    3,889

    Yes, I see the problem now. Would this work if I...

    Yes, I see the problem now. Would this work if I just put the things in the struct in the public section of the AVL_Tree class and not use the struct so that I can create nodes from the class?
  3. Replies
    7
    Views
    3,889

    Yes, that's right. And perhaps I am doing this...

    Yes, that's right. And perhaps I am doing this wrong. Is it possible to declare the AvlNode struct as if it were another class and then allow the AVL_Tree class access to the AvlNode?
  4. Replies
    7
    Views
    3,889

    AVL Tree Implementation

    I am trying to implement an AVL tree and have come up with the following code.
    However, when I try the following, I get an error saying that AvlNode is undeclared.



    int main()
    {
    AVL_Tree...
  5. Replies
    3
    Views
    2,071

    in program

    I am trying to find out how much time it takes to complete an execution of a program in Linux, by executing it from a new process. I am using the <time.h> time() function, but I get strange numbers...
  6. Replies
    3
    Views
    1,241

    I am writing a simple calculator using GTK and...

    I am writing a simple calculator using GTK and one of the buttons is clear, which is supposed to do just that. I am using strings to get the numbers and also to display the result.
  7. Replies
    3
    Views
    1,241

    How to erase strings

    I've really only programmed with C++ and not C so far, and can't find out how to clear a string in C. I have tired using clear() and erase() but get the following error message:
    "error: request for...
  8. Replies
    4
    Views
    2,444

    I downloaded the executable from sourceforge and...

    I downloaded the executable from sourceforge and I installed it to my main hard drive ie(C:\MinGW), adding C:\MinGW\bin to the PATH environment variable. The Dev-C++ I subsequently downloaded was the...
  9. Replies
    4
    Views
    2,444

    Dev-C++ Compilation Problems

    I have GTK and MSYS installed under Windows Vista. When I try to compile a c program using GTK libraries, I get the following error message:

    gcc.exe: installation problem, cannot exec `cc1': No...
  10. Replies
    1
    Views
    3,251

    Creating a Dev-C++ Project File

    I broke up my program into an implementation file, a header file and a client source code file. I am using Dev-C++ and am having trouble getting the project file to link everthing and build the...
  11. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    I now realize that I was using the stringstream...

    I now realize that I was using the stringstream improperly and found that this was the cause of a major problem. Now I know and have learned that the variables in the if () conditions just accept a...
  12. Replies
    0
    Views
    921

    Help/Suggestions with Iteration

    If you read my original post, I have edited it to show the solution I have come up with. I have been able to devise an algorithm to multiply two polynomials through the iteration and I have traced...
  13. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Thanks, that did it.

    Thanks, that did it.
  14. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Here is the loop: int poly, argument,...

    Here is the loop:



    int poly, argument, coefficient, exponent;
    char colon = ':';
    char assignment = '=';
    char multiply = '*';

    while(INPUTFILE && INPUTFILE.peek() != EOF)
  15. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Assuming the line is : show 0 I expect the...

    Assuming the line is :

    show 0

    I expect the program to enter this block because the istringstream did indeed contain a line containing show and some integer. But it does not enter that block of...
  16. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    I am confused now because I have a line like: ...

    I am confused now because I have a line like:

    2 : 3 2 1 0

    and a char object called colon assigned with ':'

    when I test the following block of code, everything works as I think...
  17. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    I have a question about istringstream. My...

    I have a question about istringstream. My inputfile has a line like:

    show 2

    and I have a string s and I assign it the string "show". I also have an int poly.

    shouldn't this statement work?
  18. Thread: While Loop

    by Bnchs400
    Replies
    3
    Views
    1,089

    Oh yes. But I did that to test to see If I could...

    Oh yes. But I did that to test to see If I could determine what was being executed and what was not. I even tried while (size >0) and for some reason, the for loops are not being executed.
  19. Thread: While Loop

    by Bnchs400
    Replies
    3
    Views
    1,089

    While Loop

    I am trying to iterate through two list objects representing polynomials to perform a multiplication operation. But I have been unable to fix the problem with the while loop because it never enters...
  20. Replies
    3
    Views
    2,337

    Overloading * Operator

    I am trying to overload the * operator to multiply two objects of my class. Since it is a binary operator I know that the function should take a LHS and a RHS parameter. However, when I try the...
  21. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Well this is just the file processing part of a...

    Well this is just the file processing part of a larger program. I have gone through several different options for extracting data from the input file and have settled with using string streams since...
  22. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    I have spent some time reading about string...

    I have spent some time reading about string stream but I have not been able to figure out how to use it to remove internal whitespace within a string. Can it indeed remove internal whitespace? Thanks.
  23. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    I am now trying to use a sstream object instead...

    I am now trying to use a sstream object instead to tokenize the string since the input file is delimited by whitespace. I am putting the tokens into a buffer and then pushing them onto a vector of...
  24. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Thanks, it works to copy the string from theTerms...

    Thanks, it works to copy the string from theTerms to s, but will it also work with the strtok() function, which is the primary reason why I am trying to do this?
  25. Thread: Strings

    by Bnchs400
    Replies
    19
    Views
    2,437

    Strings

    I am trying to assign the array of char s the string read from a file, but I get "initializer fails to determine size of s", "invalid initializer" I found an earlier post on the forum where someone...
Results 1 to 25 of 34
Page 1 of 2 1 2