cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Initializing
Initializing
Jan 11, 2013 at 10:42pm UTC
Bolong Yu
(73)
How to initialize a declared string object to hold nine empty/blank spaces?
Last edited on
Jan 11, 2013 at 10:43pm UTC
Jan 11, 2013 at 10:52pm UTC
vlad from moscow
(6539)
If you mean std::string then
std::string s( 9,
' '
);
If you mean a character array then
char
s[] =
" "
;
// there are 9 spaces.
Last edited on
Jan 11, 2013 at 10:53pm UTC
Topic archived. No new replies allowed.