Starting with C-Programming


 
Thread Tools Search this Thread
Top Forums Programming Starting with C-Programming
# 1  
Old 07-15-2013
Hammer & Screwdriver Starting with C-Programming

Hello guys!

It's been some time and I have been busy. I got my qualification as an IT-Professional now (Systems Administrator).

I learned VB.NET at school but I don't want to continue using that language, I want to learn C because I'm working with Linux/UNIX most of the time, also I do electronics and will get a Arduino soon.

I learned VB.NET (basics) the "school" way. Like how to programm a class or how the syntax of a while-loop is. I heard Richard Stallman say that you should obtain some open-source software and "expand it" by adding code or changing the software to fit your needs. I mean, after 1 year VB.NET I must say I can't use the language properly, that gets me thinking.

I already got a book about C (Galileo Computing, german site) which reads pretty well, I've been working with that.
I think that if you work hard enough, you can always reach a goal. I just want to go in the right direction from the start because I don't want to waste any time.

So here are my questions:

1. What's the best way to get started? Should I look for a projekt to programm (maybe from Rosetta Code) and start at that or should I go through C step-by-step like:
1. Data-Types
2. printf
3. scanf
4. while
5. for
...

2. How did you get started?
3. Are there any sites/books/youtube videos that you can recommend me?

greetings,

nick.
# 2  
Old 07-15-2013
Hi Nick,
I first taught myself to program with Java, then I taught myself C++. I learned both languages almost solely from a textbook. The internet usually helps where the book leaves off.

I would definitely read through the book you have first. Practice writing out some programs, either from the book or you can try to make simple program. I would also advise getting a notebook to keep some organized notes, you can make reference to later. As you get more proficient with the language, you will have to refer to it much less.

Reading the book while keeping notes and writing simple programs is definitely a start. Personally, I am not familiar with any good websites, but I know there there. I used the internet if a problem came up in my program that the book couldn't help me with. I would just Google my problem. There would usually be a forum or website with the solution.
# 3  
Old 07-15-2013
thank you very much!

maybe while I'm continuing my work with my textbook some other people have some thoughts? Smilie
# 4  
Old 07-15-2013
I'm not sure where the best place to begin is, but you need to keep one thing in mind in C. It's very different from other languages in that it's kind of a construction kit. Nearly all the features in C are there because the CPU directly supports them. All the oddness of the language, its unusual features and odd limits, its strange compilation errors stem from this -- that it is molded around the shape of the CPU itself. Anything that's not CPU-supported is done through external functions, one way or another.

Local variables really are local variables -- stored on the stack. They are directly available to the CPU if you set up space for them.

Global variables are likewise stored in the data segment, another CPU thing.

Functions are actual CPU functions, i.e. blocks of data you direct the CPU to via the CALL instruction or newer equivalents. They have addresses that you can get at, just like anything else in C.

Pointers are how the CPU deals with all memory, and are exposed directly to you, unlike most languages, which have fancy references that handle themselves, or no references at all. Variables are also handled directly with no middleman. You do A++; and the CPU will do something like INC [address of A]

So when you write a C program, you are telling it "Okay, create THESE functions, which I will call X Y and Z... with THESE local variables, which I will call Q Y and R... with these global things in the data segment, which I will call G H and M... Convert these statements into assembly language and find spots in memory for them. Convert all names into these addresses. Then staple everything together into something the CPU can load and execute directly."

Last edited by Corona688; 07-15-2013 at 03:02 PM..
# 5  
Old 07-15-2013
I am a self taught amateur at coding in a few languages.
I learn very quickly when I jump in right at the deep end and splash about a lot until my head pops up above the water.
I thoroughly enjoy _hitting_ the HW, (banging the metal), and will deliberately attempt such tasks with all kinds of languages. Strangely enough I avoid ANSI C for such tasks as I prefer to find _back_doors_ using scripting languages.
ANSI C is _relatively_ easy understand but if Arduino is what you are interested in then I have done loads to access it in different languages AND platforms; including the Classic AMIGA A1200(HD) and under emulation using WinUAE...
However I have this little gem...
Code:
"SAMS Teach Yourself C For Linux Programming In 21 Days"
ISBN 0-672-31597-1

# 6  
Old 09-04-2013
this is the bible.

Don't bother with cheap imitations

Another good reference is:

gnu libc manual

Last edited by bigearsbilly; 09-04-2013 at 07:16 AM.. Reason: stupid url button
# 7  
Old 09-04-2013
The C Programming language might be the bible, but it really is tough. Steve Summit has a good intro online: C Programming Notes One level above there is more, one of it are notes to "The C Programming language" (as far it's me they don't make it any better). good means easy. If that is too easy look at "C - A modern approach" by K.N King. I don't learn by projects, but by the books. Most tell me that is not a good approach, but i ain't got much talent (iow: i am slow).

---------- Post updated at 02:48 PM ---------- Previous update was at 02:45 PM ----------

youtube has a couple of videos about C. Some you might like. I missed that you already got a book (from Galileo Computing). If it was me i would use that for now +online ressources. As far it is me slightly too slow: https://www.youtube.com/watch?v=RpRRUQFbePU but entertaining. Then there is newboston: http://thenewboston.org/list.php?cat=14, which i don't know. Then there are youtube videos by people from India, but i can't find them right now. I liked them a lot (search for long ones).

---------- Post updated at 03:00 PM ---------- Previous update was at 02:48 PM ----------

"I mean, after 1 year VB.NET I must say I can't use the language properly, that gets me thinking." If you want to quickly do stuff yourself, then shell scripting is a better approach (Again: i am very slow, but i think that quite some people, hobbyists, would agree)

Last edited by tornow; 09-04-2013 at 04:56 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

2. UNIX for Dummies Questions & Answers

From iOS programming to Linux system programming

Hello. I like Linux and C programming language. Allways wanted to understand kernel and become a Linux system programmer. And I also like Objective-C and iOS. These two programming areas have relations: 1. Linux and iOS are UNIX-like systems, POSIX compliant. 2. It is useful to know C language... (2 Replies)
Discussion started by: Rockatansky
2 Replies

3. Web Development

What are web design programming steps starting with HTML?

I'm studying web design and I would like to know the stages to knowing what you will ultimately need to know when entering this profession. With HTML being the step one and the basics, to I think XHTML and Css, being two, what's next? JavaScript? MySQL? Can some one provide an ordered list of... (5 Replies)
Discussion started by: Anna Hussie
5 Replies

4. UNIX for Dummies Questions & Answers

How does unix system administration, unix programming, unix network programming differ?

How does unix system administration, unix programming, unix network programming differ? Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

5. Programming

C Programming - Hardware Programming

Can someone help me on suggesting some ways to access the memory content in RAM directly from C/C++ source code. Please provide me any book name or any URL so that I can get an exhaustive knowledge over it. If possible please give me some tips on interacting with hardwares directly through... (3 Replies)
Discussion started by: nandumishra
3 Replies

6. UNIX for Dummies Questions & Answers

Carreer:Networking Programming in Unix (C programming Language)

Hello, I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies

7. Shell Programming and Scripting

Unix Systems Programming Vs Unix Programming

Several months ago I found a link that explained the difference between how a Unix Systems Admin would do scripting compared to what a Unix Programmer would do. It showed a basic script and then show several iterations that explained how the Systems Admin would change it to make it better. I was... (0 Replies)
Discussion started by: BCarlson
0 Replies

8. Shell Programming and Scripting

Starting over

I am re-learning UNIX and want to download Unix to my lab for studying on the road. Any suggestions? Got several books, but need to run scripts :rolleyes: (2 Replies)
Discussion started by: DudeMan
2 Replies

9. Programming

c programming or unix programming!?

i would like advice on the usbject of c programming (in the middle of reading a book on C). could i benefit more if i apply that knowledge in the unix format if i were able to, or would that take the point out of learning C, basically I want to stay away from strying too far away from unix and use... (1 Reply)
Discussion started by: moxxx68
1 Replies

10. UNIX for Dummies Questions & Answers

Starting X?

I just installed FreeBSD 4.5 and I want to find out how I can start and run X? When I boot I get taken to the command line. Xconfigurator doesn't want to work. (2 Replies)
Discussion started by: AMDPwred
2 Replies
Login or Register to Ask a Question