answersLogoWhite

0

#include
#include

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::getline;

int main()
{
string myString = "";
cout << "Enter a string: ";
getline(cin, myString, '#'); //will stop to read string when you press # (Shift + 3)
cout << endl << "You have entered: " << myString << endl;

system("PAUSE");
return 0;
}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a program in BASIC to find the sum of the series s equals 2 plus 4 plus . plus 100?

10 print "That is not a question." 20 print "That is a command." 30 end


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


C plus plus program to print number patterns?

bghjg


Do I need a C plus plus program to print PASCAL's triangle?

No.


What is the importance of functions in a c plus plus program?

Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.


Write a program to print odd numbers In C plus plus between 51 to 100?

#include &lt;iostream&gt; int main() { for(int i=51; i &lt;= 100; i+=2) { cout &lt;&lt; i &lt;&lt; endl; } return 0; }


Write the steps in c plus plus program to print your name and age at different lines?

#include&lt;iostream&gt; int main() { std::cout&lt;&lt;"your name\nyour age"&lt;&lt;std::endl; return(0); }


How to write a program in c plus plus to print table of even number?

void print_evens (size_t n) {for (size_t x=0; x&lt;=n; x+=2) { std::cout &lt;&lt; x &lt;&lt; std::endl; } }


What are the steps in c plus plus program to print word computer?

std::cout&lt;&lt;"computer"&lt;&lt;std::endl;


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


Can you write a program to read a set of scores from a file and compute the average and print it on the screenby c plus plus?

Yes. Use cin and/or getline to read the formatted data into an array, compute the average then output the result using cout.