Run C Program in Command Prompt

Поділитися
Вставка
  • Опубліковано 21 січ 2017
  • Learn how to compile and run C programs in the command prompt/line without using an IDE. The commands are below.
    NOTE: You will need a C compiler to do this already installed, I use GCC. gcc.gnu.org/
    Commands:
    gcc 'name_of_the_file' e.g. gcc hello.c
    gcc -o 'name_of_exe' 'name_of_file' e.g. gcc -o hello helloWorld.c
    Please Subscribe !
    ►Become a Patreot: patreon.com/randerson112358
    ►Website: everythingcomputerscience.com/
    ►Support this channel get C-Programming Book:
    www.amazon.com/gp/product/013...
    Resource: ce.uml.edu/compile.htm

КОМЕНТАРІ • 74

  • @Zahra-qb7nm
    @Zahra-qb7nm 3 роки тому +7

    This was so useful, thank you👏🏻👏🏻

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

    great video man. could understand every word you spoke, thank you, there's hope for mankind yet!

  • @shaderone07
    @shaderone07 4 роки тому +4

    That was a quick helpful video!

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

    Thank u so much this small video helped me to stop quiting from c programing

  • @SARVESH_VISHWANATH
    @SARVESH_VISHWANATH 8 місяців тому

    Explained Very Well and I've learned it easily and simple to understand. Thanks a lot for posting such a very short and informative video... 😊😇🥰

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

    Thank you very helpful tutorial!

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

    Finally could run the program

  • @truthsearch2981
    @truthsearch2981 7 років тому +24

    Good video; Clearly explained, thanks.

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

    This is the best video ever

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

    Thank you brother

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

    Thank you!

  • @techbro_4309
    @techbro_4309 5 років тому +9

    You have to install a gcc compiler first
    I use this
    sourceforge.net/projects/tdm-gcc/
    It easy to download and install

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

      I also put a link to the compiler in the description.

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

      thanks

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

    thank you so much bro

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

    Help, I had a problem while compiling a files (c files), cmd always pop up when I clicked enter, and then keep pop up randomly.
    So basically, I can't compile anything.

  • @swayy_was_taken8099
    @swayy_was_taken8099 3 роки тому +9

    when i do gcc it says that its not a command. please help!

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

      that likely means you don’t have the c compiler installed

  • @tinted8244
    @tinted8244 4 дні тому

    thank you so much

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

    Champion, cheers

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

    this help me, thank a lot...

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

    Thanks!

  • @589kin
    @589kin 4 роки тому

    Thankyou! :D

  • @muhammadzohaib4792
    @muhammadzohaib4792 4 місяці тому +1

    Thanks brother

  • @aryankhullar7101
    @aryankhullar7101 6 років тому +1

    thank you very much really nice video

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

    thanks dude.............

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

    Thanks

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

    thanks

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

    thank you so much buddy love you

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

    vary good

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

    Hello. First off thank you for this; I'm grateful and impressed to see programming folks explaining this for us laymen. Secondly, I just downloaded and installed GCC this afternoon so I can begin trying to do this... and I have a little hiccup I want to ask about:
    I am at 1:16. I just typed as suggested and instead of it exporting a new C program, I have received an error message saying: "'Code\C'' is not recognized as an internal or external command, operable program or batch file."
    For context, I have an external hard drive. My C-Drive has almost no space and is overflowing, so I have taken to installing things on my external- it's in the G drive- including the GCC packet when it prompted me, and the "Hello World" .c file I typed.
    I pulled up Command Prompt; got the default line C:\Users\(myname)>; I typed G and then the folder path; and then get the error message when I try to compile the program.
    ---
    I realize this comment's a bit disorganized, but that's exactly because I'm floundering and have only a vague idea what could be wrong. Is it because it's installed in the G Drive or is something else at play here?

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

      Addendum: I have copied the .c file onto my desktop, employed the cd command to narrow down the folders, and the folder itself "not being recognized as a command" is no longer an issue.
      However, it is now also saying that gcc is not recognized as a command. I just installed it. Any tips?

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

    Thank u brrrrrrrrrrrro!!

  • @girish1052
    @girish1052 6 років тому

    why it didnt create .o file?

  • @roswithadusa8673
    @roswithadusa8673 3 місяці тому

    Hello,I have a Sourcecode with several cs files.How to do that?

  • @naurseakart1190
    @naurseakart1190 8 місяців тому

    ' scanf() ' doesn't run in VScode(its delaying more than expected) but it ran in cmd.
    Does Anyone know about this issue?

  • @206_akbarisahil7
    @206_akbarisahil7 3 роки тому

    What if my c file is in some folder in a drive

  • @tanvishroy.g2675
    @tanvishroy.g2675 4 роки тому

    how can i create a hello world program

  • @hachihao1604
    @hachihao1604 7 років тому +3

    'perl' is not recognized as an internal or external command,
    operable program or batch file.
    help me ! :(

    • @roveskar3363
      @roveskar3363 7 років тому +1

      same when i tape gcc :'(

    • @basheershamoun9153
      @basheershamoun9153 6 років тому

      you need to install minGW sourceforge.net/projects/mingw/?source=typ_redirect

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

    should have smaller than 13 of your screen, too small to see terminal

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

    I have a message saying that gcc is not recognized as an internal command. How to set it up?

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

      same could you find it?

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

      @@berkayherek1173 you need to install a compiler on your computer

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

    I cant see it clearly

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

    Im using TurboC, so instead of GCC what should I write?

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

      Hhmmm... I'm not sure, I thought this was discontinued.
      Try installing Dev C++ instead of TurboC, the below article can help you:
      “How To Install The C-Programming Language On Windows” by randerson112358 link.medium.com/6iKKlfKcaV

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

      Hi Silverballer48,
      My suggestion is for you to download either Dev C++ or Code Blocks IDE.
      A link for how to do this is below:
      medium.com/@randerson112358/how-to-install-the-c-programming-language-on-windows-c9813f1c5abb
      A video on how to install Dev C++ can be found below:
      ua-cam.com/video/3llORi4KUmA/v-deo.html

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

      @@ComputerSciencecompsci112358 Why would you recommend an IDE? I thought the whole point of this tutorial was to compile from the commandline - the IDE essentially does the same thing anyway so it's a bit of a useless suggestion.

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

      The point of this video was to show how to run a program in command prompt.
      To your question, why would I recommend an IDE? The simple answer is because their are benefits to using an IDE, although it depends on the language and IDE.
      Some of the benefits of using an IDE is listed below:
      1. Automatic code generation
      2. Auto-completion when you can't remember the names
      3. Warnings-as-you-type
      4. Hovering over something to see the documentation
      5. Integrated source control
      6. Ease of running unit tests

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

    gcc is not recognized as a command. Help!

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

      Add it to PATH variable.

    • @Me-sv2xe
      @Me-sv2xe 10 місяців тому

      ​@@plasmahvhhow

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

    Sir, I need your help
    Detailed information about web design and web development in your words

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

      Like and Subscribe My Channel
      ​ua-cam.com/video/Ddrlvu9vks4/v-deo.html
      Lectures' Language: HINDI/URDU
      It has modern Computer Science Knowledge for School, College and University students.
      In this lock-down, it will help you a lot. Dear Parents! teach your kids smart programming using MIT Scratch..Free course.

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

    Help me I tried but no such file is not recognized program Iam getting this

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

      You need to install mingw software on to your windows. From their site mingw.org

  • @vatsalyaa.m
    @vatsalyaa.m 2 роки тому +1

    Desktop is not recognised as an internal or external command
    Error.
    What to do?

    • @tinted8244
      @tinted8244 4 дні тому

      Did you do "cd Desktop"?

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

    gcc not found how i can fix that?

    • @tinted8244
      @tinted8244 4 дні тому

      You have to download the compiler. Seach "GCC compiler"

  • @roswithadusa8673
    @roswithadusa8673 3 місяці тому

    Sorry,I mean several c files

  • @nyctimus6015
    @nyctimus6015 5 років тому +18

    How is this helpful to any of you? I know the gcc commands if i get it to install on windows - you ovbiously skipped like a thousand steps. i hate seeing videos like this with comments saying " thanks so awesome!" when nothing is awesome just makes everything more irritating.

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

      Other than installing a compiler, which I have a link to that in the description, what steps did I skip?
      What do you not understand in the video?

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

      @@ComputerSciencecompsci112358 Didn't mean to come off as rude - but correct me if I am wrong it is my understanding that you cant just install gcc its meant for linux so you have to install mingw g++ compiler on a windows machine

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

      @@nyctimus6015 , what you don't understand in this video is something that I did not explain, which is how to install a C-compiler on Windows 10. Your question to me is "do you have to install mingw g++ compiler on windows" , the short answer is yes.
      This video wasn't intended to be a "how to install GCC" video, it was simply showing commands that you can use on the command line to compile & run your C-Program source file. I am thankful of all of the positive comments on my channel, I think the internet needs more of that. If you do not understand something just ask, no need to be negative, remember these videos and a lot of other peoples content is out on the web for FREE .
      I am guessing the issue is that you are having difficulty on installing the GCC compiler and mingw (Minimalist GNU for Windows). I honestly did not think it would be difficult for anyone to install the GCC compiler with so many videos, websites, & examples on the web. This may be great to make a video on, thank you for that! If you are having difficulty most likely others are as well.
      If you are having trouble downloading GCC, then download Code Blocks (codeblocks-17.12mingw-setup.exe) you can find it here: www.codeblocks.org/downloads/binaries
      or download DevC++, these are IDE's (Integrated Development Environments) that will automatically download everything you need.
      Thanks again for the video idea, and let me know if that is the issue and if one of those two options solves your problem.

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

      @@ComputerSciencecompsci112358 I have mingw downloaded, but gcc isn't recognized :(

    • @something_new97
      @something_new97 11 місяців тому

      I tried this n it's really work
      But in my case
      on my desktop the extension not shown
      If somebody have idea about this please tell me