Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Dynamically...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 8 Topic 9582 of 9831
Post > Topic >>

Re: Dynamically read string

by "Martin T." <0xCDCDCDCD@[EMAIL PROTECTED] > May 9, 2008 at 09:21 AM

howa wrote:
> Hi,
> 
> Are there any simple method to read string into dynamic array of
> string, e.g. char**
> 
> E.g.
> 
> char **c;
> 
> Since the number of line is unknown, how the dynamic allocation is
> done actually?
> 
> Thanks.
> 

If you're working with C++, you should use vector:

const char* get_string(); // for example

std::vector<std::string> my_strings;
my_strings.push_back( get_string() );
// ...


br,
Martin

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 8 Posts in Topic:
Dynamically read string
howa <howachen@[EMAIL   2008-05-08 21:29:23 
Re: Dynamically read string
Marcin Swiderski <sfid  2008-05-09 09:15:18 
Re: Dynamically read string
Maciej Sobczak <see.my  2008-05-09 09:16:01 
Re: Dynamically read string
Oncaphillis <oncaphill  2008-05-09 09:24:35 
Re: Dynamically read string
Bob Lied <lied@[EMAIL   2008-05-09 09:28:53 
Re: Dynamically read string
"Jim Langston"   2008-05-09 09:22:45 
Re: Dynamically read string
"Martin T." <  2008-05-09 09:21:07 
Re: Dynamically read string
Ulrich Eckhardt <dooms  2008-05-09 09:27:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 21:53:43 CDT 2008.