Posts

Showing posts from October, 2024

Getting started with a new RUST project using cargo

Image
  Basic use of 'cargo' in RUST programming language When installing RUST, cargo, the recommended tool for structuring your RUST project,  should be installed by default and to use the cargo command line tool do the following: Navigate to the location you wish to create your new RUST project: Create the new RUSt project's folder (make sure to have no spaces in the name): Now the folder(tutorial_cargo or however you named your project) should have been created and contains the following: And the src folder contains 'main.rs' with a simple 'Hello World' program and modifying main.rs is where you start your new RUST program!

Simple RUST input and output program

Image
 This code will prompt the user to input their username and get a custom greetings from the RUST program: To run the code type "cargo run" in cmd: