vector <char *> all_file

1
2
3
vector <char *> all_file
char *_filename_
all_file.push_back(_filename_);


If i got codes almost like this.How can i print out to check what is stored in all_file?
I wish to print out files store in all_file
for ( char *s : all_file ) std::cout << s << std::endl;
Or

1
2
std::copy( all_file.begin(), all_file.end(), 
           std::ostream_iterator<char *>( std::cout, "\n" ) );


Or

1
2
std::for_each( all_file.begin(), all_file_end(),
               []( char *s ) { std::cout << s << std::endl; } );
Or

1
2
3
4
for ( std::vector<char *>::size_type i = 0; i < all_file.size(); i++ )
{
   std:;cout << all_file[i] << std::endl;
} 
Last edited on
Or
1
2
3
4
for ( auto iter = all_file.begin(); iter != all_file.end(); ++iter )
{
    std::cout << *iter << std::endl;
}
Topic archived. No new replies allowed.