Search:

Type: Posts; User: jaxdid

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,942

    I ended up looking the official answer book and...

    I ended up looking the official answer book and they actually used a similar method. They managed to do it in one while loop by properly working down the exceptions.
  2. Replies
    5
    Views
    1,217

    I'm a newbie but well done. Prior programming...

    I'm a newbie but well done. Prior programming experience outside of c++?
  3. Are constructors basically there to initialize...

    Are constructors basically there to initialize data members in a class?
  4. Replies
    10
    Views
    1,942

    Algorithms - Draw a Box

    So I recently attempted the following exercise:



    My solution?


    #include <iostream>
  5. Thread: Header files

    by jaxdid
    Replies
    6
    Views
    825

    Weird, do you get locked out of editing your own...

    Weird, do you get locked out of editing your own posts?

    @Laserlight Thanks, this isn't my code but an answer provided by the book - formatting went weird after I copy pasted and I retyped it, my...
  6. Thread: Header files

    by jaxdid
    Replies
    6
    Views
    825

    Header files

    #include iostream
    using std::cout;
    using std::endl;

    // include definition of class Invoice from Invoice.h
    #include "Invoice.h"

    // Invoice constructor initializes the class's four data...
  7. Replies
    9
    Views
    995

    Sorry I meant determine both largest and smallest...

    Sorry I meant determine both largest and smallest number. Basically I want to be able to reject commas if they are included by user without producing an error and keeping code fairly simple. ...
  8. Replies
    9
    Views
    995

    Determine largest Number

    Morning!

    Rather straightforward exercise. The goal is to determine largest of three numbers but can't use more than if statements (no else, no nested, no && || ). Is this the most efficient code...
  9. Replies
    23
    Views
    2,084

    Wow, thanks a lot. You're the man/woman! Didn't...

    Wow, thanks a lot. You're the man/woman! Didn't know you could treat the input stream like that.
  10. Replies
    23
    Views
    2,084

    Thanks for the example code. I'll have to study...

    Thanks for the example code. I'll have to study it. A few new concepts in there I haven't caught up to but that's fine, I get the general jist of it.

    What do you think about my example below? ...
  11. Replies
    23
    Views
    2,084

    For veterans of C++, is getline your preferred...

    For veterans of C++, is getline your preferred way of getting user input? What if you're dealing with both numbers and strings? Storing a number in a string would make computations complicated....
  12. Replies
    23
    Views
    2,084

    Thanks Elysia, that's the habit I'm going with...

    Thanks Elysia, that's the habit I'm going with too.

    If I can indulge one more question about getline and input buffers.



    #include <iostream>
    #include <string>
  13. Replies
    23
    Views
    2,084

    Thanks to both of you, jocdrew21 and Elkvis. ...

    Thanks to both of you, jocdrew21 and Elkvis. Problem solved.

    I was the boob in this case...

    Should I look into the wstring, wcout, etc for more info or is that a somewhat complex concept I can...
  14. Replies
    23
    Views
    2,084

    Sorry do you mind a bit of hand holding here? ...

    Sorry do you mind a bit of hand holding here? What would be an example of a string literal in my code where I should stick in the 'L'? Although the compiler did complain when I tried...
  15. Replies
    23
    Views
    2,084

    I'm on OS X 10.9, using XCode 5.0.2. When I run...

    I'm on OS X 10.9, using XCode 5.0.2. When I run the code the usual output box doesn't show anything. Although debugger reports using 276 KB of memory, it ends up filling up the space with bars.
  16. Replies
    23
    Views
    2,084

    Good point unfortunately I had tested that and it...

    Good point unfortunately I had tested that and it still doesn't work. I had previously tried:


    std::getline( std::cin, user_first_name, '\n');

    Still no change.
  17. Replies
    23
    Views
    2,084

    Getline messing up code

    Just started in on Allain's book and rather frustratingly ran into issues despite following the book to the letter. I'm trying to wrap my head around how getline works.

    The following piece of...
Results 1 to 17 of 17