Useful Source Code Examples of C? [closed] - c

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm currently delving into learning C and whilst I'm not far into the process, I'd like some examples of fully-functioning windows applications complete with source code that aren't too complicated to study - things like calculator/notepad?
Anybody got any links to where I might find a good few examples beyond the 'converting kgs to stones' or calculating speed from time and distance?
Would certainly help my inspiration. :D
Thanks.

Did not answer exactly what you asked,but ...
Tring to solve some Euler problems is a good way to familiar with the language features.
http://projecteuler.net/

If you want examples of existing C projects, browse github/sourceforge.
I wonder though - why do you want to learn C? Seeing as you're new to C, I'm assuming you might actually mean C++.
What background are you coming from and what do you want to achieve? If you want to try some algorithms, pierr's answer is a good one to get used to any language. Also, if you're interested in learning the language detail/algorithms, avoid shiny UI temptation and stick with the command line.
If you're starting programming for the first time, glenn's answer is a good start.
If you're just interested in Windows application development, this MS tutorial looks like a good start.
If you are moving from another language, look for a specific guide (e.g. Java to C++) to fill you in on the details quickly.

There are multiple websites with numerous tutorials:
C programming
C tutor
Also, be sure to look into pointers:
something on pointers
Hope this helps

Related

how to write a web browser from stratch use c [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
These days I'm aware of the powerful web browser. In order to know what happend behind the screen. I want to write a simple web browser. But When I try to find document about that. Nothing find! Any one konw how to write a simple web browser or know where is the book will be useful. Please tell me !
Thank you very much!
Start off with a simple browser -- e.g., look at existing text only ones like lynx or w3m. Once you've got them cracked, then you can work up to adding graphical elements. It can get complicated fairly quickly, so make sure you've read the appropriate RFCs for HTTP and the W3C standards as well. These aren't light reading material though :-)
Here's something to get you started:
https://developer.mozilla.org/en/Download_Mozilla_Source_Code
C might not be the best language for this job.

Unix source code- finding my way around [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm quite interested in getting "stuck in" to some Unix source code, say Fedora or Ubuntu.
In practical terms, how would one "re-write" some part of the Unix OS. I presume you would need two machines, a dev machine and a tester? Would you need to re-install the OS on each modification of a .c file? How could I edit the file and re-compile it etc?
What resources are there for knowing which parts of a Unix OS/Kernel relate to which C files (I presume there is no C++) and how to find them?
Thanks in advance for help
ps my motivations for doing this are to eventually be able to learn more about the lower-level fundamentals of the Unix OS, so that I could try and get into programming high freq trading systems.
I think it would probably be a good idea to have some kind of virtual machine to experiment with, that way you could do a snapshot apply your changes but still be able to go back without much effort. Also it allows you to simulate communication between PCs in a simple fashion.
First you need to know what you're looking for. You want to download and look at the: linux kernel. Which is the same for Fedora and Ubuntu (and all other GNU Linux distributions). Second, you might want to start with something easy, like downloading the kernel, configuring and compiling it and booting it. Once you do that you can move up from there.

How to start programming? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I read a lot of books about C/C++ in Linux and write simple programs. Now I want to try myself with some project. What you can recommend to? (Sorry for my bad English)
If you don't know what to do and just want to get a little experience, try implementing the towers of Hanoi, it's a classical programming exercise (the Wikipedia article might seem frightening at first sight, but the actual algorithm is dead-simple and you'll find lots of material about it online, even a lot of sample implementations). First, start with a text-only solution that just prints numbers. Then, try to "draw" the towers using ASCII art. You can also do this with a GUI, but as a novice it's easiest to start with text-based version.

Compiler Design Help [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Are there any lexical, syntactic, semantic analyzers and optimizers available for download with the source code, preferably in C/C++...???
Do you want a C compiler? Yes there are so many available. You might wanna start with gcc.
I would take a look at the LLVM project. If you're looking to build a compiler of your own, targetting this architecture is quite a good idea. LLVM itself has it's own intermediate representation for assembly syntax, for which many languages, including C and D already have frontends.
You might also want to take a look at this thread from a mailing list I am part of which discusses a number of "language backends" including Parrot etc; basically a set of processors that bring languages like C, C++, Python etc down to a common level.
I am not nearly expert enough in this area as I'd like to be, but these technologies appear to be getting the experts excited. I am seriously considering getting up to speed on them.
Your question is very poorly formed. You should have googled for this.
Assuming you're writing your compiler in C (based on the tag), there's flex, quex and ragel.
To help you write your parser, there's bison.
You can Check out the Java Compiler source code:
http://openjdk.java.net/groups/compiler/

C Linux open source projects [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Sorry if this has been asked elsewhere. I am a C,Win32 developer and want to learn similar stuff in the linux world. What are the best and easy opensource projects for learning similar stuff on Linux.
Like in C,Win32 world i want to start off with User space and onto advance stuff like internals,device drivers etc. I am interested in Non UI stuff. As i have a day job and work extensively on Windows i would like to see short little projects and contribute to them in free time.
The GNU coreutils are probably as low-level and as "Linux-ey" (that's not really a word, is it?) as it gets in user space. Not always easy-to-read code, but most of those sections are bugfixes of one kind or another. So, you'll learn about some pitfalls of modern unix-like systems on the way. That, and most of the basic unix programming principles.
As most utilities are very small, just trying to rewrite some only with the spec from the manpage should give you insights into Linux (or unix for that matter) no tutorial can offer.
The book Linux Device Drivers is freely available. You can get a good overview of what's going on "under the hood" reading through that book. It also has several examples of "virtual" device drivers that don't interact with actual hardware. Follow the sample code and you can create things like a driver for /dev/null, /dev/random, etc without having to worry about hardware interfaces.
The best advice would be to pick one and stick with it no matter how overwhelming it is, once you get your feet wet in it, enjoy... this is a $64,000 question -
What specific areas of C/Win32 did you enjoy most?
Was it hardware based?
Writing drivers?
No one can answer that nor expect to pick the answer for you, except yourself....
What was it that gave you a "high" in the Win32 C world...
Once you have that answer, then look for that alternative, somewhere, in the Open Source world....and relax, participate in IRC channels, forums, and engage.
You may have to re-learn using make/gcc toolchains and autotools in order to get your feet grounded...if you're comfortable with that... excellent... :)
Some will have their coding style and standards set down in stone... so pick the easy project that you feel you'll get a kick out of, and above all, ENJOY! :D
what are you interested in ?
The nice thing about linux is that the source for almost everything is available.

Resources