Search:

Type: Posts; User: Brown Drake

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    20
    Views
    2,322

    If you're so new that nested loops throw you for...

    If you're so new that nested loops throw you for a loss, I'd hold off on Stroustroup's book for a while. Deitel & Deitel is a popular textbook.
  2. Replies
    20
    Views
    2,322

    What you want is either while loops inside an if...

    What you want is either while loops inside an if statement, or if statements inside a while loop.
  3. Replies
    20
    Views
    2,322

    Re: while loop not behaving properly.

    First, the using namespace std; should be under the #includes and before main().

    With loops it helps to step through on paper for different values. The two while loops have the same problem. Look...
  4. Replies
    8
    Views
    2,242

    The function is getch(), not getche(), unless...

    The function is getch(), not getche(), unless there's one I don't know. The exercise probably calls for getche()so that the names don't conflict. You create the getche() function, and you don't use...
  5. Replies
    3
    Views
    738

    One difference is that the Learners Edition...

    One difference is that the Learners Edition doesn't allow you to make release builds. That means you can't make an .exe file to distribute or sell.
  6. Replies
    3
    Views
    912

    I'd suggest searching previous posts. This thread...

    I'd suggest searching previous posts. This thread seems to pop up about once every week or two. Plenty of suggestions there.
  7. Re: Pointers, classes, and the HEAP....Please help!!!!!

    Frisky isn't the class, SimpleCat is. Frisky is an object, an instance of the class SimpleCat. Yes, every time you declare an instance, or object, of class SimpleCat, the constructor is called.
  8. Replies
    14
    Views
    1,119

    Pointers are used to call base class virtual...

    Pointers are used to call base class virtual functions in order to call the correct derived class function at run time rather than compile time.
  9. Replies
    10
    Views
    1,263

    Re: This is basic C++

    cout << "Hit q then enter to quit." << endl;
    displays quoted message on screen and, advances display one line, sets cursor to beginning of line

    char input;
    declares variable named input of type...
  10. Replies
    11
    Views
    2,706

    Duh...

    Don't hate to ask, that was the problem. Thanks. I was trying to get all the input on one line, e. g.
    "enter tool name, quantity...", then enter sledge hammer 43 19.99 <enter>.
    Do you know of a...
  11. Replies
    11
    Views
    2,706

    Well, that helps some, but still doesn't work...

    Well, that helps some, but still doesn't work quite right. When the program runs and asks for the user to enter tool name, quantity and cost, it hangs until any other character is entered. It also...
  12. Replies
    2
    Views
    1,137

    I'm having problems with files myself, but don't...

    I'm having problems with files myself, but don't know if you can open an ifstream with ios::out. Never seen it, anyway.
  13. Replies
    11
    Views
    2,706

    That didn't work by itself, but adding two...

    That didn't work by itself, but adding two cin.ignore()'s helped:


    if (tool.recNum == 0)
    {
    cout << "\nEnter tool name, quantity and cost: ";
    cin.ignore();
    cin.getline(tool.toolName,...
  14. Replies
    11
    Views
    2,706

    The whole function is below. toolName is a field...

    The whole function is below. toolName is a field in a struct named toolList.
    I've done:


    cin.getline(tool.toolName, 20) >> tool.quant >> tool.cost;
    and
    cin.getline(tool,toolName, 20);
    cin >>...
  15. Replies
    11
    Views
    2,706

    cin.getline in reading files?

    The code below works in writing tool.toolName, tool.quant, and tool.cost into a file when toolName is one word ("hammer", e.g.). But it doesn't work when toolName is more than one word ("power...
  16. Replies
    6
    Views
    1,101

    Re: Can someone explain what this means??

    lines++ // incremant the value contained in lines by 1. If lines == 16, lines++ sets lines to 17

    lines++ % 20 // divide lines by 20 and find the remainder. If lines == 25, lines % 20 == 5.
    ...
  17. Replies
    3
    Views
    1,003

    Shouldn't that be delete [] pointer?

    Shouldn't that be delete [] pointer?
  18. What does int ** mean? I've seen double asterisks...

    What does int ** mean? I've seen double asterisks a few places, but never an explanation of them.
  19. I don't know enough C to help you, but it looks...

    I don't know enough C to help you, but it looks like half your program is commented out. I also don't see where you use the two structs you declared, PEOPLE and *field. Where does *member come from?...
  20. Replies
    7
    Views
    1,166

    try cout

    try cout << number << " raised to the power " << power << endl;
    As for a loop, what kind do you want? One that runs till the user ends it? one that loops a certain number of times?
  21. Here's how I initialized 100 records of struct...

    Here's how I initialized 100 records of struct person.


    struct person
    {
    char lastName[15];
    char firstName[15];
    char age[4];
    };
    .
  22. Replies
    8
    Views
    970

    Whether you use int main() or int main(void),...

    Whether you use int main() or int main(void), you'll need to return, usually return 0;
    As far as I know, you can't use main() or main (void), You can use void main()
  23. Replies
    5
    Views
    1,011

    this pointer

    What you might be thinking of is the this pointer, which you return in overloaded << or >> operator functions to allow cascaded returns, like input << x << y << z; etc.
    the return is:
    return this;...
  24. Replies
    7
    Views
    941

    If I'm reading you correctly, I did add that code...

    If I'm reading you correctly, I did add that code to update in the post before yours. update doesn't hang now, but doesn't overwrite the old record with new data either. It doesn't do anything, as...
  25. Replies
    36
    Views
    2,488

    If you have an unmanageable number of variables...

    If you have an unmanageable number of variables in a class, your class is too big. Redesign it, maybe make base and derived classes or separate classes altogether. There's not a built in data type...
Results 1 to 25 of 154
Page 1 of 7 1 2 3 4