Hello world
C++ :
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!" << endl;
return 0;
}
Rust :
fn main()
{
println!("Hello world!");
}
The exclamation mark at the end of println! indicates this is a macro rather than a function. The println! macro is defined in rust standard library and is used to output to the console.