Thread: Beginner Help

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    3

    Beginner Help

    Hi all, I am new to c programing and I am having trouble using the compilers I have found. I have seen topics on how to use them but not working. I was hoping to find a compiler that I can run from a CD, so I tried "tiny C", but when I type code in the command window I get an error. How do I use the command compilers and what do I need to make them work.
    Thanks
    Ken

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    How do I use the command compilers and what do I need to make them work.
    It depends on the compiler, but are you sure you do not want to use a compiler from within an IDE instead?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    you should follow the above advice, get an all in one package downloaded and you're away, why did you want to run it from cd?

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    3
    Thanks I will follow your advice. I also like how to Ask Questions the smart way.

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    3
    Thank you for the advice. I use different pc's at work and wanted to practice my c programing on my breaks and lunch hour. The cd is because I cant load a compiler on different pc's.

  6. #6
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Have you looked at this help page?


    http://fabrice.bellard.free.fr/tcc/tcc-doc.html#SEC2

    You said you were getting errors but didn't say what they are, the mindreader who posts on this board is currently on holiday.

    He will be back next thursdays so if you hang on untill then he should have a solution for you.






    TCC options are a very much like gcc options. The main difference is that TCC can also execute directly the resulting program and give it runtime arguments.

    Here are some examples to understand the logic:

    `tcc -run a.c'
    Compile `a.c' and execute it directly
    `tcc -run a.c arg1'
    Compile a.c and execute it directly. arg1 is given as first argument to the main() of a.c.
    `tcc a.c -run b.c arg1'
    Compile `a.c' and `b.c', link them together and execute them. arg1 is given as first argument to the main() of the resulting program. Because multiple C files are specified, `--' are necessary to clearly separate the program arguments from the TCC options.
    `tcc -o myprog a.c b.c'
    Compile `a.c' and `b.c', link them and generate the executable `myprog'.
    `tcc -o myprog a.o b.o'
    link `a.o' and `b.o' together and generate the executable `myprog'.
    `tcc -c a.c'
    Compile `a.c' and generate object file `a.o'.
    `tcc -c asmfile.S'
    Preprocess with C preprocess and assemble `asmfile.S' and generate object file `asmfile.o'.
    `tcc -c asmfile.s'
    Assemble (but not preprocess) `asmfile.s' and generate object file `asmfile.o'.
    `tcc -r -o ab.o a.c b.c'
    Compile `a.c' and `b.c', link them together and generate the object file `ab.o'.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  3. Books, Beginner, MustHave
    By Zeusbwr in forum C++ Programming
    Replies: 9
    Last Post: 10-25-2004, 05:14 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM