Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-02-2005, 11:52 PM   #1
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
c/c++ linux resources

I am a programming student and I just earned my Assoc of Arts in programming. I am also a long time linux user. I am familiar with several languages, java, C#, C++, perl, bash shell scripting.

Here is my problem, When it comes to C++ I am very educated/familiar with the langiuage syntax and standard library. However I have no experience on any platform of api-platform specifics. I can easily write complex c programs that do a lot, but they only use standard language syntax and standard library.

Recently my programs have gotten larger and more complex, I have been told of functions that are specific to the operating system. Recently someone started talkign to me about "malloc()" I have no clue what it is.

Instead of simply asking what the function is and does (I have an idea from what they told me) I am instead curious as to where I can go to learn about this and the linux api in general.

I want to use the linux api, the problem is I cannot find a solution to a specific situation in a reference because I do not know it exists in the first place.

My first thaught was search for linux programming books on amazon, and find web-tutorials.

But the problem now is most of the tutorials and books use C not C++.. Why is this a problem? Because my code is all c++, its all I have learned/was taught. I follow the tutorials and understand what I am writing, but I am completely oblivious as to how I might mix what I have learned in C into my C++ code, and I am unable to expand the C code because once again I only know c++

I used to thing C++ was C with extra stuff such as objects, but apparently there are syntax differences as well because I am just lost.

So... where do I go, what do I read, what do I experiment with? How can I learn the differnces in c and C++, and how can I learn how to apply what I learn in one to the other?

Where can I learn the linux API?

I am very frustrated, please help me find resources. I am willing to put the effort into reading, experimenting, and doing things for myself, I do not expect knowledge or experience to be downloeded into my mind.
Old 09-03-2005, 08:44 AM   #2
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
With "Linux API" I suppose you are talking about the kernel.

The answer to your questions is easier as you ever thought:

All the docs you need are inside the system itself.

Get familiar with the commands man and [b]info[b]
Specially section 3 an P of the man pages.

Say you need info about the syntax of fprintf(), here's the way to ask for it:

man 3 fprintf
To learn about stdio.h

man P stdio.h
Info works similar but it works in an own browsable format:
info gcc
KDE's Konqueror browser uses a more convenient way to browse through the man and info docs just writing a line like the following into the URL window:
GNOME also offers a convenient richtext acces to all this documentation through Gnome's desktop help system (it's on the panel).

There is much more!
In /usr/share/doc/linux-VERSION
Is a Poscscript version of the whole kernel documentiotion and you can find the plain text version of *anything* in the kernel inside /usr/src/linux/Documentation.

More elaborate documentation can be fond at the TLDP (The Linux Documentation Proyect), where you can find just about anything related to your question: API, syscals, libraries for C and C++, lot's and lot's of stuff. There is the kernel hacker guide, the module programming guide, guides about the libc6, gcc and gdb (the debugger)...

aps, the URL

Normally every piece of software related to the basic toolchain (compiler, assembler, debugger, libc6, kernel and related stuff) has info in their own /usr/share/doc directory.

Furthermore: If you use KDE and the fantastic KDevelop environment you will get all the documentation indexed and some extra dox more available from the "documentation" tab just on the IDE itself...

It's not documentation what we miss in Free Software and specially not the one related to system API's

Hope it helped, and happy hacking
Old 09-03-2005, 02:05 PM   #3
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
About malloc():
If you're familiar with C++, you'll know about the new operator. Malloc() is used in C to get a block of memory dynamically, just like new in C++.
Some differences:
  • malloc() is a function, a syscall, while new is an operator.
  • With malloc() you must specify how much bytes you need, while new finds out automatically how much bytes is needed for the given object.
  • The new operator call the constructor of the object to create. With malloc(), you just ask for a certain number of bytes and you either get them all, or an error. Malloc just does that, nothing more.
  • Malloc() the more "raw" version. I suppose new actually uses malloc() behind the scene.

One resource about the Linux/UNIX API: The book "Advanced Linux Programming" is downloadable for free (1 PDF per chapter). See:
Old 09-03-2005, 02:27 PM   #4
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47
First reply:

I knew most of what you told me, I am not asking how to find out what a specific function does, my problem is I need to know the function exists before I can look it up, I need a list of functions, a list of whats what very brief, for details on what they do I have no problem.

Second reply:

Thanx, that very informative.
Old 09-03-2005, 03:42 PM   #5
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47

This sie helped me with the c VS. c++ stuff, I am pretty clear on that now, really what I need is a list of functiosn, libraries to call, and a breif description of what they do, then I can look up in depth stuff on specific functions in man pages later.
Old 09-03-2005, 03:44 PM   #6
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47 this is nice, this is probably what I was looking for, just needed to refine my google search, if anyone can give me a site that expands on it, or if someone can say how complete this list is that would be great, thanx.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Your favorite linux resources dezza General 10 05-10-2005 04:55 PM
Linux resources [LAG] Prude Linux - Newbie 1 03-17-2005 05:54 PM
Linux Resources Crimson Azure Linux - Newbie 1 09-26-2003 06:01 AM
linux resources? Suspect Linux - Newbie 2 08-30-2002 05:17 AM
Linux Resources snowboarder401 Linux - Newbie 1 08-06-2001 04:38 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration