Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,152 of 33,346    |
|    =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All    |
|    Re: why can't i access std::string with     |
|    16 Apr 12 23:35:13    |
      From: daniel.kruegler@googlemail.com              Am 17.04.2012 00:09, schrieb news.eternal-september.org:       > Hello,       >       > I'd like to access C++ strings the way i did in C , that is:       > char foo[]="foo"; //foo[0] foo[1] ...       >       > I read several times that [] was allowed for string access.              It is allowed, see 21.4 [basic.string]:              // 21.4.5, element access:       const_reference operator[](size_type pos) const;       reference operator[](size_type pos);              Note that (const_)reference are just alias for a reference to char       (const).              > Unfortunately, i think i'm missing something.       >       > #include |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca