xtd
0.2.0
hello_world_io.cpp
The classic first application "Hello, World!" with
xtd::io::file
and
xtd::io::path
classes.
#include <xtd/io/file>
#include <xtd/io/path>
#include <xtd/console>
using namespace
xtd
;
using namespace
xtd::io
;
auto
main(
int
argc,
char
* argv[])->int {
auto
file_name =
path::combine
(
path::get_temp_path
(),
"hello_world.txt"
);
file::write_all_text
(file_name,
"Hello, World!"
);
console::write_line
(
file::read_all_text
(file_name));
file::remove
(file_name);
}
// This code produces the following output:
//
// Hello, World!
Generated on Mon Oct 9 2023 14:41:56 for xtd by
Gammasoft
. All rights reserved.