| | |
The C Programming Language
![]() |
•
•
Join Date: Jul 2009
Posts: 1
Reputation:
Solved Threads: 0
Hello,
I am currently just getting started in learning my first programming language. I searched the web and decided to start with the book "The C Programming Language". The problem is I am already lost. I have no idea how to set up the Hello World program. I have a little experience coding in PHP and HTML but nothing like this. I'm not sure how to compile, what programs I need to do so, etc...
And with the commands they are giving me, I'm guessing that I need a program to type those into? I would appreciate any help on getting started. This is my first venture into the software/programming world. I start college in a few months and will be majoring in computer science. Any help would be greatly appreciated.
-Peter
I am currently just getting started in learning my first programming language. I searched the web and decided to start with the book "The C Programming Language". The problem is I am already lost. I have no idea how to set up the Hello World program. I have a little experience coding in PHP and HTML but nothing like this. I'm not sure how to compile, what programs I need to do so, etc...
And with the commands they are giving me, I'm guessing that I need a program to type those into? I would appreciate any help on getting started. This is my first venture into the software/programming world. I start college in a few months and will be majoring in computer science. Any help would be greatly appreciated.
-Peter
Download Code::Blocks, and keep these sites bookmarked:
http://www.cprogramming.com/tutorial.html#ctutorial
http://www.cplusplus.com/reference/clibrary/
http://www.cppreference.com/wiki/
http://www.opengroup.org/onlinepubs/009695399/
And just use Google.
http://www.cprogramming.com/tutorial.html#ctutorial
http://www.cplusplus.com/reference/clibrary/
http://www.cppreference.com/wiki/
http://www.opengroup.org/onlinepubs/009695399/
And just use Google.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
•
•
Join Date: Jul 2009
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Hello,
I am currently just getting started in learning my first programming language. I searched the web and decided to start with the book "The C Programming Language". The problem is I am already lost. I have no idea how to set up the Hello World program. I have a little experience coding in PHP and HTML but nothing like this. I'm not sure how to compile, what programs I need to do so, etc...
-Peter
For compiling the program, you need (naturally) a compiler. What is readily available to you depends on the system you have. If you search the internet, I would think that you should be able to find a Windows-compatible freeware C compiler somewhere without much difficulty. UNIX systems typically come with a compiler as part of the operating system. Typically compiler programs are called 'cc' or 'cc.exe', so the command to compile will typically start with cc.
Having said that, compiling is not the end of the road. Compiling will compile your program into 'object code'. It must then be linked with the libraries that have been used into an executable module (regardless of operating system). The linker program is typically called 'ln' or 'ln.exe'.
If you are new and are looking to get a rapid start, then picking up an IDE-driven system would speed your way greatly. An 'IDE' is an Interactive Development Environment, and basically provides you with a code editor and takes care of much of the bookkeeping of compiling and linking for you. That would be the 'quick-start' way to go. If you are on a Windows system, there are free 'Express' versions of Visual Studio available, and if you are on an UNIX system, then doubtless there is a similar thing available from the GNU project.
That should be enough to point you in the right direction. C is very powerful, flexible, and unforgiving, so it requires a fairly rigid self-discipline to program in well. If you can become expert in C programming, moving on to C++, C# and the like will be a largely down-hill ride. If you would like to start on an easier path, then C# is much more protective of the programmer, and syntactically very similar to C++, which is in turn very similar to C, so the reverse path is available, depending on your needs.
Uh, what?
By "msv6" do you mean Visual Studio 6? Thats a) not free b) not very standards compliant and c) old. "dev", which i guess means Dev-C++ is also dead. No new release since 2005.
The best bet is to download something like MinGW for windows and then either compile from the command line or use an IDE such as CodeBlocks (which works well with this toolchain)
By "msv6" do you mean Visual Studio 6? Thats a) not free b) not very standards compliant and c) old. "dev", which i guess means Dev-C++ is also dead. No new release since 2005.
The best bet is to download something like MinGW for windows and then either compile from the command line or use an IDE such as CodeBlocks (which works well with this toolchain)
If i am helpful, please give me reputation points.
I Third the vote for Code::Blocks
get the version "codeblocks-8.02mingw-setup.exe", it comes with the MinGW (gcc) compiler, and you cant go wrong. it's an industry standard.
I would not recommend that you use a text editor and stand-alone compiler to learn.... that will increase your frustration. i used to program that way for years, and now that i've finally moved over to IDE (integrated dev. environments) i wouldnt want to inflict notepad programming on anyone. its like going from dialup to broadband: you'll never go back.
otherwise, do stick with K&R's "The C Programming Language". you'll be better for it. you *could* get one of those "Teach yourself C" type of books, but you'll be cheating yourself.
i've just revisited the K&R book, and it is superior. make sure you use the Second Edition, though, that one is compliant with ANSI C.
also, you can get "The C Answer Book" by Tondo and Gimpel, published by Prentice Hall. It contains fully worked out solutions to all the exercises in K&R.
get the version "codeblocks-8.02mingw-setup.exe", it comes with the MinGW (gcc) compiler, and you cant go wrong. it's an industry standard.
I would not recommend that you use a text editor and stand-alone compiler to learn.... that will increase your frustration. i used to program that way for years, and now that i've finally moved over to IDE (integrated dev. environments) i wouldnt want to inflict notepad programming on anyone. its like going from dialup to broadband: you'll never go back.
otherwise, do stick with K&R's "The C Programming Language". you'll be better for it. you *could* get one of those "Teach yourself C" type of books, but you'll be cheating yourself.
i've just revisited the K&R book, and it is superior. make sure you use the Second Edition, though, that one is compliant with ANSI C.
also, you can get "The C Answer Book" by Tondo and Gimpel, published by Prentice Hall. It contains fully worked out solutions to all the exercises in K&R.
Last edited by jephthah; Jul 3rd, 2009 at 11:59 pm.
hmm... i just reread your post, i thought you were experienced in another language, but i see now that's not so much. (by the way, HTML is not a programming language, it's a markup language... just FYI.)
K&R was not really written for novice programmers. It's written for intermediate programmers who are learning C, but have a foundation in some other structured language
perhaps you might want to check out one of those Teach Yourself C books. like the Sam's series or the "____ For Dummies" series. I'm not recommending these,they don't have much professional credibility, but they will hold your hand through some of the beginner stuff.
just borrow one from the library, just long enough to build up some confidence in basics --- then come back to K&R
.
K&R was not really written for novice programmers. It's written for intermediate programmers who are learning C, but have a foundation in some other structured language
perhaps you might want to check out one of those Teach Yourself C books. like the Sam's series or the "____ For Dummies" series. I'm not recommending these,they don't have much professional credibility, but they will hold your hand through some of the beginner stuff.
just borrow one from the library, just long enough to build up some confidence in basics --- then come back to K&R
.
Last edited by jephthah; Jul 4th, 2009 at 2:34 am.
Ya I agree with jephtah . Start up with some easy book then when you think you know C to a certain extent you can come to K&R.
Or you can even come to Daniweb scan through the C forum. Because here you will get more than one ways to solve a particular problem and also the credentials of a particular way and its defects.And finally the best way to solve that problem.
Trust me just by reading the threads here you'll get to know a lot off stuff.
Or you can even come to Daniweb scan through the C forum. Because here you will get more than one ways to solve a particular problem and also the credentials of a particular way and its defects.And finally the best way to solve that problem.
Trust me just by reading the threads here you'll get to know a lot off stuff.
Last edited by csurfer; Jul 5th, 2009 at 3:32 am.
I Surf in "C"....
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Hello,
I am currently just getting started in learning my first programming language. I searched the web and decided to start with the book "The C Programming Language". The problem is I am already lost. I have no idea how to set up the Hello World program. I have a little experience coding in PHP and HTML but nothing like this. I'm not sure how to compile, what programs I need to do so, etc...
And with the commands they are giving me, I'm guessing that I need a program to type those into? I would appreciate any help on getting started. This is my first venture into the software/programming world. I start college in a few months and will be majoring in computer science. Any help would be greatly appreciated.
-Peter
Then, run your compiler. If you are on an IDE, then you shall probably have a "compile" or "build" option. If you are doing from a command line (such as Unix), use the compiler invocation from the command line (such as "gcc" or "cc"), followed by the filename.
Your compiler would usually also take care of the linking option by default. Since you are a starter, I am assuming you use the basic compiler option and that links your single file program automatically.
Now, you should have your <filename>.exe or "a.out". From IDE, you would have a "run" option, so it would be a matter of simple click-and-run. In case of command line, you need to type in the name of the executable/out program and press the "Enter" key. That should take care of running the program.
In case the output is not what you expected, you need to come back to the program code and check the logic once more to rectify.
__________________
Far Infrared Sauna Portable sauna
![]() |
Similar Threads
- Making Your Own Programming Language (Java)
- how would you make your own programming language (Computer Science)
- own programming language? (Computer Science)
- programming language recommendation (Computer Science)
- java programming language (Java)
- Programming Language required (Computer Science)
- Suggestions on what type of programming language would be best for the situation (Computer Science)
Other Threads in the C Forum
- Previous Thread: Reading link list in files..
- Next Thread: Recursion problem
| Thread Tools | Search this Thread |
* adobe ansi api array binarysearch centimeter changingto char character cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax database directory feet fflush fgets file floatingpointvalidation fork frequency givemetehcodez global grade gtkgcurlcompiling gtkwinlinux highest histogram homework i/o inches infiniteloop input interest intmain() iso keyboard kilometer km linked linkedlist linux linuxsegmentationfault list locate looping lowest match meter microsoft mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc program programming pyramidusingturboccodes read recv recvblocked repetition reversing scanf scheduling segmentationfault send single socket socketprograming socketprogramming stack standard string suggestions systemcall unix urboc user voidmain() wab whythiscodecausesegmentationfault win32api windows.h windowsapi






