Search:

Type: Posts; User: Susan

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    13,206

    cout

    cout << setiosflags(ios::fixed) << setprecision(0)
    << endl << "The square root of "<< x << " is " << GetSquare(x)
    << endl <<endl;

    by saying set precision (0) you have left no room for the...
  2. Replies
    10
    Views
    1,536

    well, i did that, sort of. my mistake perhaps...

    well, i did that, sort of. my mistake perhaps was that I returned the value back to float after I rounded to the precision I wanted.

    I have another post by susan that is a few below this one and...
  3. Replies
    10
    Views
    1,536

    interesting. don't quite know what to make of...

    interesting. don't quite know what to make of your observations. i'll make the similar changes and see what develops.

    Well, i get the same as you, it works.

    guess we need some name space...
  4. Thread: cout vs. printf

    by Susan
    Replies
    19
    Views
    4,740

    have you tried #include string...

    have you tried
    #include <string>
    string stringname;

    getline ( cin, stringname, termination character optional );


    or

    getline ( cin, stringname );
  5. Replies
    10
    Views
    1,536

    I was afraid of just the answer you gave! I...

    I was afraid of just the answer you gave! I rebooted and still had the same error. Does this mean that my compiler is corrupted in some way and I have to reinstall my compiler?
    Susan
  6. Replies
    10
    Views
    1,536

    how can 0.00665 not equal 0.00665??!!

    OK, I must be missing something. How can 0.00665 not equal 0.00665?

    I hard code mytemp = 0.00665;
    then i read in with cin >> searchValue to be 0.00665

    then I test to see if they are equal (...
  7. Replies
    6
    Views
    5,557

    Hadn't thought of the delta. I tend to be very...

    Hadn't thought of the delta. I tend to be very litteral and exact was my first instinct. Thanks for pointing out another way to go. Will consider this and save for future applications.
    Thanks!
  8. Replies
    6
    Views
    5,557

    thanks S. C. and Tim, i'll give it a try. I...

    thanks S. C. and Tim, i'll give it a try.

    I had the idea about multiplying by 100000 but i was looking at ceil() and had not considered floor(). neat trick. i like it.

    now on to tim's part....
  9. Replies
    6
    Views
    5,557

    does C++ have a round () function?

    I have 2 floating point numbers with different significant digits.

    I want to round a floating point number from

    0.832557389... to 0.83256000... so i can compare it to another double that...
  10. double did it. thanks susan (and son)

    double did it. thanks

    susan (and son)
  11. I will try and make it a little more clear, I...

    I will try and make it a little more clear, I hope.

    the number is in a string. it is 10 digits long. we want it to be the data type integer or long or what ever will hold it without going into E...
  12. string with 10 numbers to int, please. Can I avoid overflow?

    Hi,
    We are trying to convert a string that has an IP address that we have taken the dots out of. So the string is now
    "##########" (10 characters long where # = 0-9). we want to convert it to be...
  13. thank you all very much. I miss PL1. that is...

    thank you all very much. I miss PL1. that is how old of a programmer i am!
    C++ - so many ways to do something that should be simple.
    well, my son's program is running thanks to you all.
    Happy...
  14. tried this cout

    tried this
    cout << "/n this is chunk1 = " << ipchunk1.c_str() << endl;

    Execution/run time error:
    the instruction at 0x00422820 referenced memory at
    0x00000000. The memory could not be...
  15. How do i convert a string to a character array?

    How do i convert a string to a character array?

    We are using a command line prompt like this:
    int main(int argc, char **argv)

    We put the argv into a string variable like this:
    ipstring =...
  16. Dear Shmulik, Ya, hoo. theString.erase(); ...

    Dear Shmulik,

    Ya, hoo.
    theString.erase(); worked perfect. I think that using.erase() is more explicit than just setting the string = to a null quote.

    Thank you. I also wonder where...
  17. Replies
    3
    Views
    997

    Wish I could. Thanks agian. nite, s :)

    Wish I could.

    Thanks agian.

    nite,
    s
    :)
  18. Replies
    3
    Views
    997

    SilentStrike I love you!!!!!!!!!!!!!1

    Yea!!!!!!!!!
    The simple answer is the best.
    My prog. works great!

    I tried all kind of things.

    I tried myString = '\0' to clear it out and then it would not concatenate with another stirng.
    ...
  19. Replies
    2
    Views
    1,426

    HI, I think you are looking for a way to show...

    HI,
    I think you are looking for a way to show the decimal and trailing zeros.

    You need

    cout.setf (ios::fixed | ios :: showpoint);
    cout.precision (2);

    I just studied for a test on this very...
  20. Book says that "theString.clear();" is in Compiler says no. What can I do?

    Hi,

    My first time here.

    I have a very old degee in CPS and am taking a C++ class and I want to clear my string. I don't want to
    thestring = ' ';
    because I want to concatenate other...
Results 1 to 20 of 20