Menu

Word wrap in Dev C++

2009-04-03
2012-09-26
  • Holly Benton

    Holly Benton - 2009-04-03

    Please help, I am new to programming, and I am trying to find the answer in my books and on the web but can't seem to find it. I wrote a program

    include <iostream>

    include <string>

    using namespace std;

    int main ()
    {
    string name;
    string subject;

    cout &lt;&lt; &quot;Welcome to Holly's Crystal Ball!&quot; &lt;&lt; endl;
    cout &lt;&lt; &quot;What is your name, please?&quot; ;
    cin &gt;&gt; name;
    cout &lt;&lt; &quot;Hello,  &quot; &lt;&lt; name &lt;&lt; &quot;. My name is Holly.&quot; &lt;&lt; endl;
    cout &lt;&lt; &quot;What subject are you studying?&quot; ;
    cin &gt;&gt; subject;
    cout &lt;&lt; &quot;Well,  &quot; &lt;&lt; name &lt;&lt; &quot;, Holly's crystal ball says you will do very well in  &quot;
        &lt;&lt; subject &lt;&lt; &quot; this term.&quot; &lt;&lt; endl;
    cout &lt;&lt; &quot;Good luck!&quot; &lt;&lt; endl;
    
    system (&quot;pause&quot;); //needed in bloodshed to pause system
    return 0;
    

    }

    That is my code, and it runs just fine except for the fact that some times it will cut mid word in the line

    cout << "Well, " << name << ", Holly's crystal ball says you will do very well in "
    << subject << " this term." << endl;

    Any help would be appreciated.

    Thanks

     
    • Holly Benton

      Holly Benton - 2009-04-06

      Thanks Clifford, I will check that out.

       
    • cpns

      cpns - 2009-04-04

      I believe that Tools->Editor options (or something like that - I no longer use Dev-C++ or have it installed) has an option to enable/disable line wrapping. It is not on by default, so you must presumably have set it. Line wrapping is a really bad idea in a code editor IMO, I cannot think of a good reason to have it, but most IDE's do for some reason.

      I see you are breaking ground in AI with this application ;-) Ready for the Turing Test with this one!

      Clifford.

       
    • Holly Benton

      Holly Benton - 2009-04-04

      Thanks Clifford, I will check that out.

       
    • Holly Benton

      Holly Benton - 2009-04-05

      Thanks Clifford, I will check that out.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.