Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

HOW TO USE STRINGS IN C++ ?

0 votes
asked Nov 10, 2019 by Drilleba Joshua (290 points)

2 Answers

0 votes
answered Nov 10, 2019 by RAKESHMADDI (180 points)

getline() :- This function is used to store a stream of characters as entered by the user in the object memory.

push_back() :- This function is used to input a character at the end of the string.

pop_back() :- This function is used to delete the last character from the string.

commented Nov 12, 2019 by ANDRUA JOSHUA (160 points)
are these examples of strings you know?
+1 vote
answered Nov 10, 2019 by xsevdam (350 points)
#include<iostream>
using namespace std;
int main()
{
 string name,surname;
 cout<<"your name:";
 cin>>name;
 cout<<"your surname:";
 cin>>surname;
 cout<<name<<" "<<surname;
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...