ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Then go to Start -> Run, type cmd and press ENTER.
Then type c:\, press ENTER.
Then compile your program with gcc.
It doesn't have to be c:\, but you have to navigate to the directory. You can't just try to compile samp.c from anywhere. What if you have more than one file called samp.c on your harddrive? That's why the directory structure exists in the first place. Learn it, use it, own it.
How did you install the compiler? Are you using Cygwin? If so, I think you need to be running in some sort of shell enviroment for unix commands to work. The README file or googling for "cygwin" should point you in the right direction.
gcc is a command-line program. You need to invoke it from the shell, or DOS prompt. Depending on what flavor of gcc it is, it will use certain environment variables to locate the files it needs in order to operate. For instance, it needs to know where to find the include files. You need to find out what kind of gcc installation this is.
Running raw gcc is an advanced issue if you are used to Windows packaged GUI applications. Perhaps you would be better served with a copy of Visual Studio. Failing that, find out who installed gcc, ask them where it came from, and then read the instructions for using it. I admit that this is a complicated problem, but gcc simply wasn't intended to be used directly from a windowed environment without running some sort of setup script first.
If you are just trying to experiment with the C language then you should create a DOS window/session (or command prompt, or whatever they call it these days) and type the name of the command (test). If you do not run it at the command prompt then you will not be able to see the output. I think that the cygwin compiler has an option to create a terminal window when you run the program, but I do not know how to invoke that option.
Originally posted by itsme86 There's no such thing.
That is not entirely true. The floating point binary format allows for several special values, including infinity, negative infinity, and NaN (Not a Number, or "undefined"). They are obscure and only heavy-math guys use them. I know how to use these values with C++ but C is not so clear to me. My understanding is that you include math.h and use the macro INFINITY. You can do a google search for "C language float infinity" for more information.
Most people's first programs do not take numeric cardinality into consideration. Good show!
But I suspect I am missing something here. In what context do you need to use infinity? Are you talking about an infinite loop?