How to Build / Compile and Run a C Program in Command Prompt ( cmd ) on Windows 10

Поділитися
Вставка
  • Опубліковано 10 жов 2024
  • in this video tutorial you will learn How to compile/ build and run a C language Program in command prompt on windows 10 operating System.
    skip to start Writing code 04:57
    After installing C toolset ( mingw oin windows is used here ) we need to set the path environment variable.
    After that we need to open the command prompt and use the command
    gcc program.c
    this will generate the executable from the program.
    we can use a.out and run the program.
    We can also give name for the executable generated by using
    gcc -o program.exe program.c
    Learn about
    Toolset Toolchain Ide's
    • Tool set, Tool chain a...
    Installing Mingw
    • MinGW Compiler Suite I...
    Installing CodeBlocks ide
    • Installing CodeBlocks ...
    Watch Video tutorials in HINDI at
    / learningladhindi
    #CProgramming #LearningLad
    Catch us on Social Media
    facebook / learninglad
    twitter / learningladedu
    Google+ www.google.com/...

КОМЕНТАРІ • 231

  • @andylunatic3174
    @andylunatic3174 2 роки тому +4

    Thank you so much! Finally I found this video. I'm learning the C programming in the university but nobody explaind how I can create .exe from my .c. But now everything works perfectly. You are amazing!

  • @andyrodriguez2660
    @andyrodriguez2660 5 років тому +4

    I have been trying to do this for days but all other tutorials were not good enough. Thank you.

  • @Muskan-hn8ib
    @Muskan-hn8ib 3 роки тому +1

    after watching many videos on you tube this is the only video who explain it in proper way well don sir..

  • @alexschmidt4427
    @alexschmidt4427 5 років тому +16

    This is very powerful actually I am going to practice doing that all the time on cmd. Thanks for every new awesome feature that you provide

    • @LearningLad
      @LearningLad  5 років тому +4

      my pleasure.
      keep learning :)

  • @alexschmidt4427
    @alexschmidt4427 5 років тому +20

    Their is a lot of tutorials on UA-cam about programming in general but none of them (at least for my watching and searching) have explained how to deal with the Installer tool of your own program.

  • @captain_shrug
    @captain_shrug 4 роки тому +23

    ah, finaly someone showing me why my WinGW was not found. Thank you very much :)

  • @peacefirst4884
    @peacefirst4884 3 роки тому +4

    Thank u 💕.. After watching so many videos I reached here and this is the only one worked

  • @laurentiutrifan9092
    @laurentiutrifan9092 4 роки тому +8

    Thank you for the patience and the simple but efficient explanations.

  • @soroushfathi5537
    @soroushfathi5537 3 роки тому +3

    thank you so much, finally, i run the c program in cmd with your tutorial, 👍🙋‍♂️

  • @riturani2489
    @riturani2489 2 роки тому

    Thanks a lot sir. You know what I'm so happy. Maine kitne hi videos dekhe the but ye ho nhi paya Maine finally apne semester ke last din ye dikha and i did it. Thanku so much🙏🙏

  • @jmccm7739
    @jmccm7739 4 роки тому +3

    thank you man,i really didn't wanna mess with dual booting linux and windows

    • @LearningLad
      @LearningLad  4 роки тому +3

      my pleasure.
      dual booting is not that hard

    • @batmanjpeg
      @batmanjpeg 4 роки тому +1

      Hackerman

  • @ProfreshionalLifeBeyond
    @ProfreshionalLifeBeyond 3 роки тому +7

    Thank you very much, Anil. Your instruction was thorough and easy to follow. I have not been coding for sometime yet I managed to get all the way through. Best wishes from Melbourne Australia, Minh

    • @LearningLad
      @LearningLad  3 роки тому +1

      You are most welcome

    • @ProfreshionalLifeBeyond
      @ProfreshionalLifeBeyond 3 роки тому

      @@LearningLad All the best with all that you do. May you and your loved ones stay safe during this virus season.

  • @GaddamTejendra
    @GaddamTejendra 3 роки тому +2

    Thanks bro,the video uploaded an year ago.but it still helps many

  • @Alpha-uw6wn
    @Alpha-uw6wn 3 роки тому +2

    I am learning with ur videos... Than k u🥰

  • @charlesjsescoto
    @charlesjsescoto 3 роки тому

    You are the only one i see on youtube explain how to do this and how this is works, ty for that

  • @FEETOFKEELEY
    @FEETOFKEELEY 2 роки тому +2

    Thanks a lot. 👍🏻👍🏻 Extremely helpful. Compiling with MinGW becomes lot easiier now. Please make a video on compiling both C and C++ programs with Clang compiler on Windows.

  • @mudangkano5267
    @mudangkano5267 2 роки тому +1

    It was very useful for me.
    You r better than other youtubers

  • @nilkamalwaghamare4583
    @nilkamalwaghamare4583 2 роки тому +1

    this video is very helpful to me....nice work keep doing it.....best of luck

  • @nighilenthbb6338
    @nighilenthbb6338 3 роки тому +2

    Thank you so much bro
    I was not able to set the path
    🙏🙏

  • @MK-pu6xj
    @MK-pu6xj 10 місяців тому +2

    your explanation was very helpful🤩

  • @zxnnightstalker2289
    @zxnnightstalker2289 3 роки тому +20

    This is where my journey on C/C++ starts.

    • @LearningLad
      @LearningLad  3 роки тому +4

      All the best :)

    • @fabi___n5277
      @fabi___n5277 2 роки тому

      How has your journey been so far?

    • @zxnnightstalker2289
      @zxnnightstalker2289 2 роки тому +1

      @@fabi___n5277 I am in C++ Metaprogramming. I think I am intermediate. But at the same time I have to get the job, so I am mostly doing android Development. But in C++,
      I can work with type traits and STLs.

  • @surajkumar-yn1ty
    @surajkumar-yn1ty 2 роки тому +1

    thnks man. i was able to install and run my first program in one go. t

  • @godrexer7641
    @godrexer7641 2 роки тому

    the video has been created so simply yet so complete in details...thank you...keep it up

  • @MinatoKushinalovers
    @MinatoKushinalovers 23 дні тому +1

    You're a livesaver. Thanks man

  • @roshan6362
    @roshan6362 4 роки тому +10

    This is exactly what I wanted thank you so much bro

  • @samdavepollard
    @samdavepollard 4 роки тому +2

    Good one.
    Many Thanks for sharing your knowledge.

  • @sanjeevmaharjan9795
    @sanjeevmaharjan9795 5 років тому +6

    thank you so much you explained it in great detail.

    • @LearningLad
      @LearningLad  5 років тому +1

      my pleasure
      keep learning :)

  • @nokashich
    @nokashich 3 роки тому +1

    1st four days nobody likes college days then ul start loving it

  • @hideakipage8151
    @hideakipage8151 3 роки тому +2

    Clear, simple and direct. Many thanks.

  • @lawo4443
    @lawo4443 3 роки тому +2

    Thank you man 🖤✌️

  • @ayan6871
    @ayan6871 3 роки тому +2

    Finally I understood..thank u so much 😊

  • @CG-yw3eq
    @CG-yw3eq 3 роки тому +3

    In previous video "How to install CodeBlocks....", you saved used user variable environment to save the path. In this tutorial, the system variable is used. Is there a difference?

  • @AmineOnline
    @AmineOnline 3 роки тому +2

    Realy realy helpfull and joyfull!

  • @oasacademy1771
    @oasacademy1771 2 роки тому +1

    thanks Anil bhai

  • @Zaza_7
    @Zaza_7 3 роки тому +1

    If you don't like the video hit the dislike button hurt me....
    Great video you have explained me the thing which took my teacher 2 hours.
    UA-cam is indeed our 2nd tchr shoutout to every1 out there.

  • @Umapriya.
    @Umapriya. 3 роки тому +2

    Thank you so much this video helped me a lot.

  • @mechguy0404
    @mechguy0404 3 роки тому +1

    thanks for making this video...

  • @smileySmit
    @smileySmit 2 роки тому +1

    thank you video is really helpful

  • @oudomchem5133
    @oudomchem5133 4 роки тому +3

    Thank you sir.

  • @Lyric_Beat
    @Lyric_Beat 4 роки тому +2

    loved the video great explanation . Thank you

  • @melkenhoning158
    @melkenhoning158 4 роки тому +3

    Who ever decided that Windows doesn't need a built-in compiler because "no one would use it" deserves a firm kick in the balls

    • @yuli3873
      @yuli3873 3 роки тому +1

      Windows doesn't need Python or C built in, but Spotify and Candy Crush instead /s

  • @_t.anu._.1864
    @_t.anu._.1864 2 роки тому +1

    Informative one.. Ty

  • @jimmymesa
    @jimmymesa 5 років тому +2

    Good one. Not very complicated.

  • @matsaramachandrarao2746
    @matsaramachandrarao2746 2 роки тому

    Thanks bro, this video is very useful for beginners like me.

  • @madhurigaikwad6274
    @madhurigaikwad6274 3 роки тому +1

    This video is a life saver

  • @dipaligode6962
    @dipaligode6962 2 роки тому +1

    Thank you 😊

  • @dracula3387
    @dracula3387 3 роки тому +1

    thanks lad u helped me

  • @dionjohnson4655
    @dionjohnson4655 3 роки тому +2

    great thanks it works but still showing an error on my code as int a problem how to solve them when I compile them using online dgb it completes fully without any error so please find a solution for that also.

    • @LearningLad
      @LearningLad  3 роки тому +1

      i don't really get your problem.
      check whether in your code, you have declared some variables and haven't used them

  • @alinanaqvi1340
    @alinanaqvi1340 2 роки тому +1

    Your videos have been so helpful. I was going out of my mind trying to download a compiler for C because our teacher tells us not to use vs studio, but your videos have made it so clear, thanks so much.

  • @nokashich
    @nokashich 3 роки тому +1

    bloody awsum if I'm finding programming books

  • @taherahmed7398
    @taherahmed7398 3 роки тому +2

    Awesome. You did a great job Man. Thank you so much

  • @CSERaginiGupta-vc8hd
    @CSERaginiGupta-vc8hd 3 роки тому

    Thank-you so much
    I got fom beginning to the end all info

  • @adarshsingh1420
    @adarshsingh1420 4 роки тому +3

    Thanks buddy It helped me a lot ;-)

    • @LearningLad
      @LearningLad  4 роки тому +3

      Glad it helped

    • @Deepak-bk3lz
      @Deepak-bk3lz 2 роки тому

      @@LearningLad Not able to work ..need more help

  • @satyabratbarik204
    @satyabratbarik204 2 роки тому +1

    It works
    Thank you

  • @yourlinuxguy
    @yourlinuxguy 2 роки тому

    Keep it up, Guys you can do this.

  • @sjjayaswal7621
    @sjjayaswal7621 2 роки тому

    Good information 👍

  • @jkrowlingsslave
    @jkrowlingsslave 3 роки тому +1

    Thank you!

  • @niteshmodi5468
    @niteshmodi5468 3 роки тому

    Thank you bro. Nice explanation.

  • @ebrimasaho7978
    @ebrimasaho7978 5 років тому +3

    the lectures are arranged sequentially

  • @sonammalik17
    @sonammalik17 3 роки тому +1

    Osm bro u made my day

  • @muralidhar394
    @muralidhar394 5 років тому +2

    Thanks a lot bro

  • @prasadghodake3169
    @prasadghodake3169 2 роки тому +1

    Thanks

  • @priyeshpramanik6411
    @priyeshpramanik6411 4 роки тому +1

    Thanx for you help

  • @tjmozdzen
    @tjmozdzen 3 роки тому +1

    Very nice!

  • @arijeetsingh9444
    @arijeetsingh9444 3 роки тому +1

    Thanks.

  • @djstudio759
    @djstudio759 2 роки тому

    Thnx ❤️

  • @nani.official45
    @nani.official45 3 роки тому +1

    When typing gcc (file name)
    Showing error message like no such file or directory
    Fatal error: no input files &
    Compilation terminated

  • @shrinidhikulkarni2231
    @shrinidhikulkarni2231 5 років тому +2

    its not working in my pc its returning access is denied can u say wats the problem in this case

    • @yashbitla4603
      @yashbitla4603 4 роки тому

      Did you get a solution for this? I'm getting the same error

  • @brianmuhia2955
    @brianmuhia2955 3 роки тому +1

    great video

  • @ohmyfoodies2753
    @ohmyfoodies2753 3 роки тому +1

    Tysm❤

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

    thank you

    • @LearningLad
      @LearningLad  Рік тому

      You're welcome

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

      I had codeblocks already so I was very happy seeing my version when I typed gcc --version!

  • @rachanabubna7172
    @rachanabubna7172 4 роки тому +1

    Can you please help me.. I am not able to do file handling using command prompt.. It's showing some absurd error for fputs function

  • @cookingwiththehaitiantwist
    @cookingwiththehaitiantwist 3 роки тому +1

    OMG THANK YOU!!!!
    I spent a week trying to figure out why mine was not working. I am using the book: « Learn C programming » by Jeff Szuhay. I used g++ instead of gcc since in the book, we were supposed to use cc instead. Anyways! I definitely need to understand the logic behind all of this in order to make sense of what I am doing.
    In this short video, I was able to learn a lot about the simple hello work language, why we use the symbols that we use, etc.. I will look for more details, because I like to understand the « why » if everything that I do.
    Your video was very useful! Thank you so much!

  • @doly099
    @doly099 3 роки тому

    Thanks a lot❤️❤️ i'm very much grateful to you for this tutorial

  • @alexschmidt4427
    @alexschmidt4427 5 років тому +2

    Hello Anil how are you beside UA-cam?
    I'm wondering if you can teach us how to make a C++ program that runs automatically when Windows starts. This thing is unique as well as your videos and is very important.
    As an example for that is the Discord desktop application. When you install discord on your desktop, every time you turn your computer on, your default browser will always open Discord's main page automatically.
    Hope I was clear enough. XD
    Thank you for your time .

    • @LearningLad
      @LearningLad  5 років тому +1

      first create the program to do your intended task.
      place it in windows start up
      That's it

    • @alexschmidt4427
      @alexschmidt4427 5 років тому

      @@LearningLad Ofcource but if I uploaded my program to let others download it, how would they have the program opened each time windows restarts. They only should install the program and the rest is for the installer. So my question here is: "How do we make our installer to automatically add the executable to the startup menu?"
      Thank you again

  • @ayushimishra3032
    @ayushimishra3032 4 роки тому +2

    Can you please tell me how to run a c project source code .I have the SourecCode of the project but i dont know how to run it please do tell !!!

  • @play7.017
    @play7.017 3 роки тому +1

    thnx bro

  • @bharatibansode5871
    @bharatibansode5871 2 роки тому

    Nice exlplatnation

  • @getptv8356
    @getptv8356 5 років тому +2

    thanks very much!!!!!!!

    • @LearningLad
      @LearningLad  5 років тому

      my pleasure.
      keep learning :)

  • @sheetalpandey8299
    @sheetalpandey8299 5 років тому +2

    Happy holi sir

  • @shuaidea
    @shuaidea 3 роки тому +1

    thank u

  • @anthonymarquez2542
    @anthonymarquez2542 3 роки тому +1

    great vid

  • @shalenmathew
    @shalenmathew 2 роки тому

    God bless you

  • @Hafizislam177
    @Hafizislam177 3 роки тому

    love you bro

  • @ParadoxPRIMITIVE
    @ParadoxPRIMITIVE 3 роки тому

    thanks so much!

  • @bewiings
    @bewiings 2 роки тому

    Whenever i execute a program it shows codeblocks process returned 0(0x0).execution time 0.39 second
    can you help me with this ? :') and not to mention this video was very helpful for a beginner like me .

  • @ravd2379
    @ravd2379 2 роки тому

    thank so much man that helped alot
    f.m its allways those indian dudes

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

    I didn't get "a.exe" instead I got "a" only, how do I fix that?? Please let me know how to fix it and thank u for the video

    • @LearningLad
      @LearningLad  Рік тому

      that's ok
      i think in your system displaying file extension option is disabled
      so you see only 'a'

  • @minhphunguyen4472
    @minhphunguyen4472 3 роки тому +1

    Hey, as I can see in some other videos, they have a line "Execution time: " everytime they run the ".exe" file, do you know how to display that line ?
    thanks mate!

    • @LearningLad
      @LearningLad  3 роки тому +1

      I think that depends on the idea/ toolset they are using
      I think codeblocks ide displays that info

  • @payalsagar1808
    @payalsagar1808 3 роки тому +1

    Wow thanks a lot:)

  • @thulanitinashe6475
    @thulanitinashe6475 4 роки тому +1

    on the last part when we change the name of the a.exe when i did it another a file was developed hello.exe but not replaced it. Is it the name same thing?

  • @hjk86259
    @hjk86259 3 роки тому +1

    Can't we change the code while we once run thee code on cmd??(when cmd is working)

  • @pritesh_2564u
    @pritesh_2564u 2 роки тому

    Can we use microsoft word to write our c code ?

  • @000hugohew
    @000hugohew 4 роки тому

    Hi may I know how client (Win 10) can execute the application by using the CLI run the apps in failover cluster (server) thank you.

  • @eldhoelbinjohnson4099
    @eldhoelbinjohnson4099 3 роки тому +1

    Sir while typing gcc hello world.c it shows fatal error. Pls tell for this sir pls

    • @LearningLad
      @LearningLad  3 роки тому

      if your file name contains space then write it between double quotes
      gcc "hello world.c"

  • @sherlitanavarro2752
    @sherlitanavarro2752 3 роки тому

    Can you add how to open a programs help system🤔

  • @woonsuanloo5560
    @woonsuanloo5560 4 роки тому +1

    After I hit enter after I typed 'a' into the cmd, I got the message 'Access is denied.'. Would you know how to solve this error?

    • @sauravpatwardhan8765
      @sauravpatwardhan8765 3 роки тому

      this is an issue related to your Antivirus software. it always happens on my pc too. You need to switch off real time scanning while running your newly created program. Turn it back on after you are done. The antivirus doesn't allow you to run it because the source is new and unknown.. so to be safe you are denied access. Hope it helps

  • @harshavardhan6823
    @harshavardhan6823 3 роки тому +2

    I Am Not Getting The result ,Instead I am getting access denied . plz reply me

  • @amitavpanda3417
    @amitavpanda3417 5 років тому +1

    what does dir mean and why u type dir ?
    plz response

    • @laurentiutrifan9092
      @laurentiutrifan9092 4 роки тому

      dir command displays the content of the current directory - that means all the subfolders, files and details about them. It's a way to check your files and - more important - the file exact name before typing in command line.

  • @dichithareddyreddy5035
    @dichithareddyreddy5035 2 роки тому

    I am unable to run the code which has to take input from the user .It is displaying "Access is denied." can you please look into that .for me hello world program is working.