C++ - Command line arguments and user keyboard input

Опубликовано: 31 Май 2026
на канале: Multilingual Programming
136
like

Video Chapters (table of content with clickable links into a specific part of the video)
00:00 Introduction about the video content
00:39 Prerequisites (you should have some programming skills in at least some language)
01:10 Command prompt (showing the g++/clang++ versions, creates new directory, starts Visual Studio Code)
01:53 Creates a "Hello World" function
03:17 Compiles and executes the "Hello World" application from the command prompt
04:24 Replaces the implementation with code receiving arguments from the command line and the keyboard
07:57 Compiles and executes the program from the command prompt
08:41 Shows a potential problem when using cin for multiple inputs and when using white space as input
10:07 Shows a solution of above mentioned problem ('getline' for each text input)
10:56 More info about 'cin' and 'getline'

Please note that you can choose to show subtitles for the videos.

Currently (when this video was published) there are not many videos in the below playlists but please remember to subscribe to this channel if you think you are interested in future videos which will become added to the play lists.

Playlists for "Program arguments from command line and keyboard input" for different programming languages:
Playlist for the videos with english voice and english subtitles:
   • Program arguments from command line and ke...  
Playlist for the videos with swedish voice and swedish subtitles:
   • Program argument från kommandoraden och in...  

C++ playlist (english):
   • C++ - Command line arguments and user keyb...  
C++ playlist (swedish):
   • C++ - Program argument från kommandoraden ...  


C++ documentation:

main function:
https://en.cppreference.com/w/cpp/lan...

getline function:
https://en.cppreference.com/w/cpp/str...

cout:
https://en.cppreference.com/w/cpp/io/...

cin:
https://en.cppreference.com/w/cpp/io/cin

Usage of "using namespace std;" should be avoided:
http://isocpp.github.io/CppCoreGuidel...



MSYS2 (tools for Windows, e.g. g++ and clang++)
https://www.msys2.org

g++/gcc
https://gcc.gnu.org

clang++/clang
https://clang.llvm.org/

Visual Studio Code (cross-platform editor):
https://code.visualstudio.com/download