dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Email spam project - getline problem

  1. #1
    Join Date
    Aug 2019
    Posts
    6

    Email spam project - getline problem

    I have to take in the body message of an email but one requirement is that the user has to press enter on an empty line to finish the body.

    So I cout << "Enter the body of the email. Press Enter on an empty line to finish.";

    How can I have it collect lines until it finds a \n and then use getline(cin, body);

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,033

    Re: Email spam project - getline problem

    Get the length of the line. It's either going to be 0 or 1 character (depending on how you are checking for Enter \n).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)