Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not. I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them. Thank you in advance for your suggestions. MEM
Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them.
The man pages are usually of some help. For example try # man log For more general advice you might try a google search (there are quite a lot of code examples out there) or one of the mailing lists on http://p2p.wrox.com/linux/ that are specifically about programming in the linux environment. JDL
On Wed, Mar 27, 2002 at 12:56:12AM -0600, Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
SuSE includes the man pages which document the C library and system calls. If you are serious about UNIX/Linux programming, then I would recommend getting a copy of _Advanced Programming in the UNIX Environment_ by W. Richard Stevens. HTH, -v -- Victor R. Cardona Powered by SuSE Linux 7.1 (i386) Professional GPG key ID E81B3A1C Key fingerprint = 0147 A234 99C3 F4C5 BC64 F501 654F DB49 E81B 3A1C
Just to add to the other comments. For the most part, Linux provides many of the standard Unix system calls. However, each version of Unix (eg. Irix, Tru64 Unix, HP-UX, Linux, FreeBSD, Solaris), have many extensions. I have had my version of K&R since 1979, and learned C from it. The C language has changed considerably and is now covered by an ISO standard. There are many excellent books on C. I prefer those written by Harvey Deitel (a former professor of mine). If you stick to ISO (ANSI) C your C programs should be relatively portable across platforms. ISO C defines the standard C library (mostly described in K&R). Most C library and system calls are described by online man pages on SuSE as well as other Unix systems. But you can also look at the header files for some system calls. On 27 Mar 2002 at 0:56, Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them.
Thank you in advance for your suggestions.
MEM
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
-- Jerry Feldman Portfolio Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Compaq Computer Corp. 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752
I am a veritable novice programmer, altho I have written a lot of Basic, (over 40 years!) and a small amount of Pascal. When I looked at C, I was basically told that C is obsolete, and I would have to study C++ if I wanted to pursue the language. So I bought a book, and I'm in the first few pages of C++. Is there, by any chance, an on-line tutorial in C++ ? Something you could access on a regular basis that would take you thru lessons? I may have to actually go back to physical school to learn this language, because there are a lot of things that don't make sense to me. (I don't know what I would do with it, since I'm an RF engineer, and I don't do any coding of processors, but everybody says that any coding nowadays is in C++. I used to write programs that would solve certain functions, like programming the numbers into a digitally controlled phase- locked-loop. (I would figure out the divide ratios, etc., and then give the answers to a real programmer!) --doug At 08:53 03/27/2002 -0500, Jerry Feldman wrote:
Just to add to the other comments. For the most part, Linux provides many of the standard Unix system calls. However, each version of Unix (eg. Irix, Tru64 Unix, HP-UX, Linux, FreeBSD, Solaris), have many extensions. I have had my version of K&R since 1979, and learned C from it. The C language has changed considerably and is now covered by an ISO standard. There are many excellent books on C. I prefer those written by Harvey Deitel (a former professor of mine). If you stick to ISO (ANSI) C your C programs should be relatively portable across platforms. ISO C defines the standard C library (mostly described in K&R). Most C library and system calls are described by online man pages on SuSE as well as other Unix systems. But you can also look at the header files for some system calls.
On 27 Mar 2002 at 0:56, Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them.
Thank you in advance for your suggestions.
MEM
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the archives at http://lists.suse.com
-- Jerry Feldman Portfolio Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Compaq Computer Corp. 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the archives at http://lists.suse.com
On Wed, 27 Mar 2002 21:33:39 -0500 Doug McGarrett <dougmack@i-2000.com> wrote:
When I looked at C, I was basically told that C is obsolete,
Not true. The linux kernel is in C, and that will probably never change. Most new linux software is in C. Ever try Perl? It can do just about anything you want, it is fast to write and test. -- $|=1;while(1){print pack("h*",'75861647f302d4560275f6272797f3');sleep(1); for(1..16){for(8,32,8,7){print chr($_);}select(undef,undef,undef,.05);}}
Il 11:43, giovedì 28 marzo 2002, zentara ha scritto:
On Wed, 27 Mar 2002 21:33:39 -0500
Doug McGarrett <dougmack@i-2000.com> wrote:
When I looked at C, I was basically told that C is obsolete,
Not true. The linux kernel is in C, and that will probably never change. Most new linux software is in C.
C is just as good as C++ when you are doing low-level coding. If you are a beginner, and you are not planning to work with C project, C++ is better to learn (even if the language is much bigger).
If you want a small but powerful, mathamatically clean and typesafe language, then try Oberon (www.oberon.ethz.ch). There is an Oberon-to-C compiler available (for free) which opens you the door to the rest of the world. ------------------------------------------------- Frank Hrebabetzky Tel./Fax: +55 / 48 / 235 1106 Florianopolis email: frankh@terra.com.br Brazil On Thu, 28 Mar 2002, Praise wrote:
Il 11:43, giovedì 28 marzo 2002, zentara ha scritto:
On Wed, 27 Mar 2002 21:33:39 -0500
Doug McGarrett <dougmack@i-2000.com> wrote:
When I looked at C, I was basically told that C is obsolete,
Not true. The linux kernel is in C, and that will probably never change. Most new linux software is in C.
C is just as good as C++ when you are doing low-level coding. If you are a beginner, and you are not planning to work with C project, C++ is better to learn (even if the language is much bigger).
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
On Thu, Mar 28, 2002 at 05:43:04AM -0500, zentara wrote:
On Wed, 27 Mar 2002 21:33:39 -0500 Doug McGarrett <dougmack@i-2000.com> wrote:
When I looked at C, I was basically told that C is obsolete,
Not true. The linux kernel is in C, and that will probably never change. Most new linux software is in C.
Actually, most systems software is still in C. Even if it were in C++, it would probably not use the features that make C++ differnet from C anyway. -v -- Victor R. Cardona Powered by SuSE Linux 7.1 (i386) Professional GPG key ID E81B3A1C Key fingerprint = 0147 A234 99C3 F4C5 BC64 F501 654F DB49 E81B 3A1C
While Stroustrup's book is good, for someone with no OO background wanting to get your feet wet in C++, I recommend Bruce Eckel's Thinking in C++. This book is available on line, from www.mindview.net. Eckel's approach is much less terse, and brings you through the concepts very well. It is a good teaching book as well as a good reference. And you can't beat the price. -ronc
First, the C language is certainly not obsolete. Certainly, languages like C++ and Java have moved it to a higher level. In my personal case, I learned several computer languages, Pascal, C, C++, BASIC, several assembler languages through online tutorials. It is important to first understand the art (or technique) of computer programming. Most books on computer languages today contain a CD-ROM. Also, with any computer language, if you do not use it, you will forget it. Some of the worst programs I ever worked with in my 30 years (with some time out as a military pilot) was programs written in one language that compiled in another. (There are a system I worked with once written by a FORTRAN programmer who hated COBOL. The program was a FORTRAN set of programs written in COBOL). The same applies to C vs. C++. C++ is an object oriented language. IMHO, it is important that C++ programmers know and understand C, but also that they write their code in good C++ style with properly developed classes and methods. Both C and C++ have their places in the progrmming lexicon. I also prefer programmers, when learning C++ to learn C++, not Visual C++ (or IDE based C++). IDE based languages are great time savers, but they also hide a lot of details. I think it is important to understand the fundamentals, that is why I think that before you learn C++, you should have a working knowledge of C and the concepts of OO. And, before you learn C, you should understand the properties of twos complement arithmetic as well as floating point. And, you should have an understanding of the things that can bite you in the ass. Another good C++ book is the C++ Primer. The most recent C++ compiler for Linux is GNU G++ 3.04. I believe that SuSE 7.3 uses G++ 2.95. I prefer using emacs, which is very C aware, but Kdevelop is a decent IDE for Linux if you want to use the assistance of the IDE. As I mentioned before Harvery Deitel and son's C/C++ How to Program is a good book, but may be a bit difficult. Some colleges, such as the University of Phoenix have online course offerings. I know that the University of Massachusetts in Lowell also used to have an online Java course. -- Jerry Feldman Portfolio Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Compaq Computer Corp. 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752
Il 14:31, giovedì 28 marzo 2002, Jerry Feldman ha scritto:
First, the C language is certainly not obsolete. Certainly, languages like C++ and Java have moved it to a higher level.
C++ can do the same low level coding as C (even if it has no advantages over it). For a beginner, I think C++ is better because it can help with both ancient programming techniques and modern (OOP) techniques.
IMHO, it is important that C++ programmers know and understand C, but also that they write their code in good C++ style with properly developed classes and methods. Both C and C++ have their places in the progrmming lexicon.
In the very long term I think C will disappear a bit before C++ :-)) I do not think that C is required to learn C++, even if it can help in the beginning.
I also prefer programmers, when learning C++ to learn C++, not Visual C++ (or IDE based C++). IDE based languages are great time savers, but they also hide a lot of details. I think it is important to understand the fundamentals, that is why I think that before you learn C++, you should have a working knowledge of C and the concepts of OO.
It is an approach, but you can learn OOP just while undertanding the C++ syntax. You cant learn a thing without coding a little, right? What's better than C++ to code OOP if you want to learn C++?
Another good C++ book is the C++ Primer.
I really like the Stroustrup: it's just better than the bible, you can always reread it and learn something new.-) Praise
You make some excellent points. Stroustrup's book is certainly a must. Both C and C++ are here for the long haul, but there are some subtle differences when you use a C++ compiler to compile C code. I think that eventually, even Unix/Linux kernel code will be converted to C++. I also think that the original K&R book (not the 2nd edition) is required reading to understand the philosophy behind both C and Unix. But, to reiterate my objection to learing Visual C++ is that you do not learn the fundamentals of the language. Visual languages are excellent when applied to GUI based applications. You can get those apps up and running quickly without the need to to be concerned about implementation details. But, if that is the only kind of programming you know, then you limit your career. At one of my contracts, we had a client - server application where the server was written in C (on Debian at the time) and the client was C++ (on Linux, Solaris, OS/2, Windows). We had access to some C++ programmers in the IT groups, but almost all of them were strictly Visual C++ programmers with none of the lower level skills needed for the queing and comminucations client side code. Additionally, one of the things that separates an application programmer from a systems level programmer in C++ is class libraries. All C++ programmers know how to write a class, but writing a good template or class that is flexible and usable enough to be used effectively requires more thought and knowledge. As an example, on a system I worked on the segment I worked on required a date that was easily comparable. They had already defined a date class, but that class was not appopriate for the type of comparisons needed because the class designer had not forseen the need. The solution was to write a new date class. Set it up such that we could restructure the old date class to inherit the new class. It is the understanding of both inheritance and templates that is very important in the writing of good class libraries. So, the bottom line is your career objectives. If you want to become a C++ programmer qucikly then the visual route will get you there, but with a very limited career. But the learning of the fundamentals, which is slower and more painful, will give you a much broader choice within your career. On 28 Mar 2002 at 16:17, Praise wrote:
Il 14:31, giovedì 28 marzo 2002, Jerry Feldman ha scritto:
First, the C language is certainly not obsolete. Certainly, languages like C++ and Java have moved it to a higher level.
C++ can do the same low level coding as C (even if it has no advantages over it). For a beginner, I think C++ is better because it can help with both ancient programming techniques and modern (OOP) techniques.
IMHO, it is important that C++ programmers know and understand C, but also that they write their code in good C++ style with properly developed classes and methods. Both C and C++ have their places in the progrmming lexicon.
In the very long term I think C will disappear a bit before C++ :-)) I do not think that C is required to learn C++, even if it can help in the beginning.
I also prefer programmers, when learning C++ to learn C++, not Visual C++ (or IDE based C++). IDE based languages are great time savers, but they also hide a lot of details. I think it is important to understand the fundamentals, that is why I think that before you learn C++, you should have a working knowledge of C and the concepts of OO.
It is an approach, but you can learn OOP just while undertanding the C++ syntax. You cant learn a thing without coding a little, right? What's better than C++ to code OOP if you want to learn C++?
Another good C++ book is the C++ Primer.
I really like the Stroustrup: it's just better than the bible, you can always reread it and learn something new.-)
Praise
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
-- Jerry Feldman Portfolio Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Compaq Computer Corp. 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752
Il 16:58, giovedì 28 marzo 2002, Jerry Feldman ha scritto:
You make some excellent points. Stroustrup's book is certainly a must. Both C and C++ are here for the long haul, but there are some subtle differences when you use a C++ compiler to compile C code. I think that eventually, even Unix/Linux kernel code will be converted to C++.
Hurd is programmed in C++, right? Btw, C++ has no advantages over C in writing low level code, but it helps when you need modularity. We have Linus, who reject patch which are not modular, so we do not need C++ for Linux. Moreover, I do not think C++ is the better choice when you program a monolitic kernel.
I also think that the original K&R book (not the 2nd edition) is required reading to understand the philosophy behind both C and Unix.
Culture is culture, and that reading is surely not a waste of time.
But, to reiterate my objection to learing Visual C++ is that you do not learn the fundamentals of the language. Visual languages are excellent when applied to GUI based applications. You can get those apps up and running quickly without the need to to be concerned about implementation details. But, if that is the only kind of programming you know, then you limit your career.
I agree 100%
All C++ programmers know how to write a class, but writing a good template or class that is flexible and usable enough to be used effectively requires more thought and knowledge.
You are very true. It looks like KDevelop too does not help with templates... or am I dumb and it really does templates with a wizard?? Praise
On Wed, 27 Mar 2002 17:56, Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them.
Thank you in advance for your suggestions.
MEM
Hi Maura, If you are after C code examples have a look at Snippets. It has quite a large collection of code samples. Extract from the site "The SNIPPETS collection started out in the late 1980's as a personal project to collect useful snippets (hence the name) of C, and later C++, code which would be free for reuse in a personal or commercial environment. Over time, it has grown to more than 94,000 lines of code in over 700 separate files. The goal of SNIPPETS is to collect and disseminate the best C/C++ answers to "How do I...?" programming questions." http://www.snippets.org/snippets/home.php3 Another Site which I have bookmarked but have not looked at for quite a while is and don't really know if it is suitable, but here goes: http://www.devx.com/sourcebank/ I will leave the doc questions to others, except to say use the man pages and have a look at the documentation section on the SuSE disks. I know the GCC manual can be found there amoung other things. Regards, Graham Smith ----------------------------------------
Il 16:33, mercoledì 27 marzo 2002, Graham Smith ha scritto:
On Wed, 27 Mar 2002 17:56, Maura Edelweiss wrote:
Does anyone know about some good examples of C code programs / routines ??? I wonder whther SuSE kit comes with something of this kind. I only have the C manual by Kernighan and Ritchie. For writing simple C program this is sufficient. However for system calls it's not.
I remember all SGI UNIX (called IRIX) systems come with on-line documentation of each C library function and program samples illustrating how to use them.
Have you checked "info libc" ? Praise
participants (10)
-
Doug McGarrett
-
frankh@terra.com.br
-
Graham Smith
-
Jerry Feldman
-
John Lamb
-
Maura Edelweiss
-
Praise
-
Ron Cordell
-
Victor R. Cardona
-
zentara