Search
 
SCRIPT & CODE EXAMPLE
 

CPP

string in cpp

// you want to include <string>
#include <string>
#include <iostream>

int main() 
{
  string helloWorld = "Hello World!"; // creating string and assigning
  std::cout << helloWorld;            // will output what you assigned it!
                                      /* you can also use strings with user 
                                      input (cin/getline)*/
  string namePerson{};
  getline(cin, namePerson); // getline allows for multi word input
  std::cout << namePerson;  // outputs name which person inputted
}
Comment

string in C++

#include <iostream>
#include <string>

int main(){
	std::string name = "Eria";
    std::cout <<name;
}
Comment

string in c++

#include <bits/std.hc++>
using namespace std;

int main(){
 	string word = {"Hi  this my account on instgram 0.wht"};
  	cout<<word<<endl;
  
 return 0;
}
Comment

C++ String Example

#include <iostream>  
using namespace std;  
int main( ) {  
        string one = "Welcome to";    
        char ch[] = { 'S', 'o', 'f', 't', 'h', 'u', 'n', 't'};    
        string two = string(ch);    
        cout<<one<<endl;    
        cout<<two<<endl;    
}
Comment

what is a string called in c++

#include <iostream>

int main() {
  char name;
  
  std::cout << "Enter you name: ";
  std::cin >> name;
  
  std::cout << "Hello " << name << "
";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: simple interest rate 
Cpp :: C++ bool 
Cpp :: bounded and unbounded solution in lpp 
Cpp :: onactorbeginoverlap c++ 
Cpp :: c++ Is there still a need to provide default constructors to use STL containers 
Cpp :: tutti i tipi di equazioni trigonometriche 
Cpp :: 771. Jewels and Stones leetcode solution in c++ 
Cpp :: Chef and Feedback codechef solution in cpp 
Cpp :: print all chrchetrs of a string c++ 
Cpp :: how to write string in c++ 
Cpp :: double pointers C++ 
Cpp :: subsequence 
Cpp :: binpow in fenwick tree 
Cpp :: c++ cin string 
Cpp :: what is push() c++ 
Cpp :: swap first and last character of string in c++ 
Cpp :: print all even number using for loop c++ 
Cpp :: create a bitset of 1024 bits, 
C :: malloc is undefined 
C :: boolean in c 
C :: sstf program in c 
C :: C float division 
C :: type change in c 
C :: fonction recursive successeur nombre chaine de caractere en c 
C :: c for schleife 
C :: c float to string 
C :: stdio.h in c 
C :: c# for loop decrement 
C :: merge sort for strings in c 
C :: c int to char 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =