Why should I know this?

프로그래밍 언어 4종 헬로월드 CFG (C,C++,Rust,Go) 본문

Technic

프로그래밍 언어 4종 헬로월드 CFG (C,C++,Rust,Go)

die4taoam 2018. 8. 15. 12:30

"Hello World" in C



"Hello World" in C++

"Hello World" in Go



"Hello World" in Rust




<사용된 소스코드>

$ cat C_hello.c

#include <stdio.h>

int main()

{

        printf("Hello world\n");

}



$ cat Cplus_hello.cpp

#include <iostream>

using namespace std;

int main()

{

        cout << "Hello World" << endl;

}


$ cat go_hello.go

package main


import "fmt"


func main() {

    fmt.Println("hello world")

}


$ cat rust_hello.rs

// This is the main function

fn main() {

    // The statements here will be executed when the compiled binary is called


    // Print text to the console

    println!("Hello World!");

}

Comments