this can work
char tmp[101];
scanf("%100s", tmp);
string a = tmp;
More Related Contents:
- how to change to c code while using for loop and array
- What is the difference between palindrome permutation and permutation? [closed]
- How to convert an instance of std::string to lower case
- C++ Convert string (or char*) to wstring (or wchar_t*)
- What are the mechanics of short string optimization in libc++?
- Remove spaces from std::string in C++
- Why should one not derive from c++ std string class?
- Convert string to variable name or variable type
- How do I convert a double into a string in C++?
- Fastest way to get IPv4 address from string
- How do I check if a C++ string is an int?
- How I can print the wchar_t values to console?
- How can I get double quotes into a string literal?
- Find out if string ends with another string in C++
- C++ string to enum
- Split a string using C++11
- Case insensitive std::string.find()
- Convert String containing several numbers into integers
- How to read cin with whitespace up until a newline character?
- C++ string::find complexity
- How to use string.substr() function?
- Is it reasonable to use std::basic_string as a contiguous buffer when targeting C++03?
- How to convert a char array to a string?
- write and read string to binary file C++
- How to read and write a STL C++ string?
- Convert string to mathematical evaluation [closed]
- Convert char * to LPWSTR
- string::size_type instead of int
- How to convert a string of hex values to a string?
- Where are string literals stored, and can I modify them?