Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to set a string equal to another string cpp

// string::assign
#include <iostream>
#include <string>

int main ()
{
  std::string str;
  std::string other="The quick brown fox jumps over a lazy dog.";

  str.assign(other);
  std::cout << str;
  return 0;
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #set #string #equal #string #cpp
ADD COMMENT
Topic
Name
1+4 =