Thread: Not printing..

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    25

    Not printing..

    Hey all! I found these awesome forums today. I now need help. I am a 100% newbie and when I try to run teh following code, it doesnt display, I will show you the code, then the putput from Dos.

    Code:
    #include <stdio.h>
    
    int main(void) {
        printf("Hello World!");
    
        return 0;
    }
    and this is what i do in dos (it returns nothing):


    Code:
    Microsoft(R) Windows DOS
    (C)Copyright Microsoft Corp 1990-1999.
    
    C:\>gcc c:\c\first.c
    
    C:\>

    Thanks for hte help! (In advance)
    Thanks

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    GCC is the compiler. You first compile the C-source code to an executable. In the same directory as your C-source code, you will find a file called a.exe. This is the executable your compiler has created and which you can run.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    25
    Ok, I get you now, How do I compile with GCC though?
    Thanks

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    You already did: GCC is the compiler program. When you want to compile a single C source-code file with GCC, you call GCC and provide it with the name of that file:

    c:\some_directory\gcc sourcefile.c

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    25
    Oh, ok. But I cant find the EXE now..
    Thanks

  6. #6
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    The EXE which GCC creates is called A.EXE. You can find it in the directory from where you have called GCC.

    So if you have a C sourcecode file in c:\temp1 and you are in c:\temp2 and compile like c:\temp2\gcc c:\temp1\source.c, then in c:\temp2 you will find your A.EXE.

  7. #7
    Registered User
    Join Date
    Jan 2003
    Posts
    25
    Ok, I found it, Thanks alot
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# Printing Problem
    By silverlight001 in forum C# Programming
    Replies: 0
    Last Post: 03-23-2009, 01:13 AM
  2. generic printing preferences dialog box
    By stanlvw in forum Windows Programming
    Replies: 8
    Last Post: 06-27-2008, 02:20 AM
  3. printing data to a file
    By coralreef in forum C Programming
    Replies: 3
    Last Post: 11-02-2006, 08:10 PM
  4. need help relating printing?
    By omarlodhi in forum Linux Programming
    Replies: 0
    Last Post: 03-03-2006, 04:46 AM
  5. Printing
    By Dual-Catfish in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-25-2002, 08:10 PM