How to run C++ program in command prompt

Поділитися
Вставка
  • Опубліковано 1 лют 2023
  • Writing a hello world program in C++ language and compiling and executing it using Command Prompt (CMD)
    #cmd #howto #C++ #c++programming #programming
    #shorts #youtubeshorts #shortsvideo #beginner

КОМЕНТАРІ • 50

  • @robertchoate359
    @robertchoate359 10 місяців тому +21

    gcc is the compiler he’s calling the compiler to run his code. For those of you saying it’s not working you have to load MSYS and load it into your Windows environment by adding it as a variable

  • @user-ql7pw7ld1n
    @user-ql7pw7ld1n 5 місяців тому +1

    So cool...I loved it

  • @AtifAhmed-67
    @AtifAhmed-67 Місяць тому +2

    Download Dev C++❤

  • @pooja6487
    @pooja6487 8 місяців тому +1

    Thank you very much sir helped alot❤

  • @coolmc7976
    @coolmc7976 Рік тому +5

    helped

  • @TheTimeProphet
    @TheTimeProphet 8 місяців тому +15

    Naughty Naughty I gave you a thumbs up, but you should never namespace STD.

    • @zenith2808.
      @zenith2808. 7 місяців тому +1

      Agreed

    • @pabblo1
      @pabblo1 7 місяців тому +2

      Why not? It's just a Hello World program.

    • @zenith2808.
      @zenith2808. 6 місяців тому +1

      Yes but it’s bad practice to do “using namespace std”

    • @GDT-Studio
      @GDT-Studio 3 місяці тому +2

      I love using namespace, it makes the code smaller and readable.

    • @zenith2808.
      @zenith2808. Місяць тому

      In small projects, that’s alright but when you’re doing massive or medium sized projects, using namespace std causes namespace poisoning. That is, user functions or keywords may clash with std members.

  • @nadkoch
    @nadkoch 4 місяці тому +2

    Спасибо, постоянно забываю что консоль можно открыть так.

  • @ulasarslan2577
    @ulasarslan2577 14 днів тому

    But need a compiler g++ llvm-devel and others😅

  • @camwha5904
    @camwha5904 10 місяців тому

    Forgot the Dreamscape music lol

  • @jakeelunker176
    @jakeelunker176 9 місяців тому +4

    it compiles for me but when I try to execute ‘a’ it says “a is not recognized as an internal or external command”

    • @adnananjum9131
      @adnananjum9131 5 місяців тому

      Try doing "cd " and after a space, write the path to the directory where you saved your code.
      For example: cd Desktop/CPP
      Adjust it according to your directory. Now, write "a" or "a.exe".

    • @roblox_game518
      @roblox_game518 2 місяці тому +1

      The code in the video are not right..
      right code
      #include
      using namespace std;
      int main() {
      cout

  • @HassaanNonari
    @HassaanNonari 4 місяці тому

    Where is return keyword for int function 😂

  • @just_the__facts
    @just_the__facts Рік тому +9

    G++ is giving issues it's saying that it is not recognized as internal external command

  • @user-cv7ws7nu4d
    @user-cv7ws7nu4d 9 місяців тому +2

    i followed exact same steps but i didnt go through.
    why is that so?

    • @RidanKhan931
      @RidanKhan931 9 місяців тому

      did you put return 0; ?

    • @user-cv7ws7nu4d
      @user-cv7ws7nu4d 9 місяців тому

      yes i did .
      still don't know what to do.?!?@@RidanKhan931

  • @Lilyys
    @Lilyys 7 місяців тому

    that window where you print the output. Mine is in dark mode. Is there a way to change it back to light mode?

    • @1223emerald
      @1223emerald 26 днів тому

      Yep, go to display settings. Its been 6 months so I guess you already found it

  • @user-xxCATALONIA
    @user-xxCATALONIA 7 місяців тому

    Why explain quickly !!

  • @abdulmohaimin9729
    @abdulmohaimin9729 7 місяців тому +2

    How did it work without return 0

    • @pabblo1
      @pabblo1 7 місяців тому +2

      Most compilers by default assume return 0.

  • @monlanoza7480
    @monlanoza7480 Місяць тому

    🇵🇮

  • @drzahraa-oc5jl
    @drzahraa-oc5jl 5 місяців тому

    I followed this step but the word doesn’t come it say error I don’t now why I am very confused and sad

    • @Hal0gen
      @Hal0gen 2 місяці тому

      you have to install gcc

  • @siddharthmeshram237
    @siddharthmeshram237 7 місяців тому

    How about return 0 since it's int main()

    • @pabblo1
      @pabblo1 7 місяців тому

      Most compiler will automatically assume return 0.

  • @raquelruizespejo8888
    @raquelruizespejo8888 Рік тому +1

    ork 100%

  • @dilshadansari-vu3je
    @dilshadansari-vu3je 8 місяців тому

    I need help bro