learn me c

A

anand devarajan

hi friends,
im anand im just a beginner in c learning for the past two
weeksnow i can write simple prgs can anyone help me to get well known
to c lang so that i should able to write even tough prgs in c
 
N

newbie

It has taken me 1 year to learn C. I did this by reading a c++ book,
then reading a generally available c book, then trying to program and
making so many mistakes it is unbelievable (well actually to the c
guru's out there - Heathfield and Thompson - this probably is
believable), and then when I thought I knew c I bought a copy of K & R.
Only after reading that do I now feal comfortable with c.

I think unless you are a robot the only way you are gonna learn is by
reading, making mistakes and learning by them.

Sorry if this is not much help.

P.S. If your gonna learn c you must buy a copy of K & R. I think the
fact that I had already read other programming books before reading it
definately helped me because they do assume that you are familiar with
a programming concept.
 
N

noridotjabi

This is all worng.
It has taken me 1 year to learn C. I did this by reading a c++ book,
then reading a generally available c book, then trying to program and
making so many mistakes it is unbelievable (well actually to the c
guru's out there - Heathfield and Thompson - this probably is
believable), and then when I thought I knew c I bought a copy of K & R.
Only after reading that do I now feal comfortable with c.

Absoultely not. There is no reason to learn C++ before C, it will just
confuse the hell out of you. Don't do any of this. The best place to
start isn't even IN a book, its in a simple tutorial. K & R is far to
hard for a beginner to read, but some other books are okay. There are
pleanty of other ways to get confortable with C. Just google C
tutorials. What skill level are you? What do you know now? What do
you want to learn?
I think unless you are a robot the only way you are gonna learn is by
reading, making mistakes and learning by them.

This is also wrong. You can't exactly make mistakes reading and if you
do you have much bigger problems. In C mistakes are not learned from
so much as made into habits (if they don't generate errors). My
biggest tip if you have a warning FIX IT.

Actually, robots don't learn anything, they just do what they are
programmed to and pick up information if that is what they're
instructions told them to. What are you trying to say.

Any the only way to learn C is to use it! You can't just read and
learn. Copy the source in the tutorial or book. Not copy and paist,
manually type it up as a copy, that really helps, then use what you
learned to make programs.

All reading and no compiling will make gcc a dull boy.
(assuming you use gcc which imho you should however this is off topic
for this group.
Sorry if this is not much help.

Its not, if you want to LEARN C and not just be farmilliar with it.
P.S. If your gonna learn c you must buy a copy of K & R. I think the
fact that I had already read other programming books before reading it
definately helped me because they do assume that you are familiar with
a programming concept.

This is not true at all. In order to learn C you do not have to buy
any books at all, it helps by is not required. All sorts of info is
free in the maigcal world were EVERYTHING is, called the internet.
Hope this helps erase what he just told you.
Nori

P.S. You did not learn C in a year, it is not possible to learn the
whole language, and it is less possible to do it in a year. I have
been LEARNING C for the past 4 years and I still have barely touched
the tip of the iceberg. A good understanding, a great understanding
even, is very differnt than KNOWING the whole thing.
N
 
N

newbie

This is all worng.

I think you mean "wrong"! And I think you forget this is my opinion
and situation. If this was not the case for you then don't worry I
have not implied that this is the opinion of all c programmers. But I
am sure you will rip my words apart and tell me that I did.
Absoultely not. There is no reason to learn C++ before C, it will just
confuse the hell out of you. Don't do any of this. The best place to
start isn't even IN a book, its in a simple tutorial. K & R is far to
hard for a beginner to read, but some other books are okay. There are
pleanty of other ways to get confortable with C. Just google C
tutorials. What skill level are you? What do you know now? What do
you want to learn?

Oh dear you seem to have taken most of my comments literally, for
example the robot comment below, but, and quite the opposit, you seem
to have decided that I implied that he should learn c++ first! I
merely said that I read a c++ book before learning c.
This is also wrong. You can't exactly make mistakes reading and if you
do you have much bigger problems. In C mistakes are not learned from
so much as made into habits (if they don't generate errors). My
biggest tip if you have a warning FIX IT.

Do you not think that by usimg the internet etc, that you are going to
be "reading"! Also I did say by making mistakes. How can you make
mistakes if you don't actually compile and run any programs. I would
have thought this would be implied. Sorry if this is not!
Actually, robots don't learn anything, they just do what they are
programmed to and pick up information if that is what they're
instructions told them to. What are you trying to say.

Who said anything different?
Any the only way to learn C is to use it! You can't just read and
learn. Copy the source in the tutorial or book. Not copy and paist,
manually type it up as a copy, that really helps, then use what you
learned to make programs.

All reading and no compiling will make gcc a dull boy.
(assuming you use gcc which imho you should however this is off topic
for this group.

Why can't you learn something by just reading? I am not impying that I
used this method - although you seem to have taken this quite
literally!
Its not, if you want to LEARN C and not just be farmilliar with it.

Maybe for you. But of course you should remember this is an opinion
and not a fact so there's no need for you to get all defensive and
corrective. But I am sure you will do it again.
This is not true at all. In order to learn C you do not have to buy
any books at all, it helps by is not required. All sorts of info is
free in the maigcal world were EVERYTHING is, called the internet.
Hope this helps erase what he just told you.
Nori

I don't understand, can no-one apart from yourself have an opinion on
something?
P.S. You did not learn C in a year, it is not possible to learn the
whole language, and it is less possible to do it in a year. I have
been LEARNING C for the past 4 years and I still have barely touched
the tip of the iceberg. A good understanding, a great understanding
even, is very differnt than KNOWING the whole thing.
N

Hey, if that's your level of c after that period of time then good for
you. People learn at different rates. If I were a rocket scientist
would you still expect me not to learn c in a short period?
 
N

noridotjabi

People learn at differnt rates, and I was meerly stating my opion, I
didn't mean for it to appear the way that it did reading it over.
Sorry.
Nori

P.S.
People learn at differnt rates, I was trying to modest. If you want to
know
I have made a:
-Linux web browser
-Linux text editor
-Windows text editor
-Cross platform shell
-A text based adventure game
-A IDE for my (that works on linux and windows)
-Scripting language

All in C. I'm not saying I learn slow, I am saying that there is
always more to learn. I guess you never heard of hacker ethics, thats
okay.

Also, It just shows how great a person you are for trashing someone
else. I was meerly saying that I disagreed with your ideas, I should
have put inho at the top of the post, but I didn't again sorry.
I however didn't insult you in any shape mannor or form where as you
insulted me:
But I am sure you will rip my words apart and tell me that I did.
But I am sure you will do it again.

And btw you stated nowere in your post that this was your opinion.
Also, the robot thing was a joke, oh well.
N
 
A

Andrew Poelstra

This is all worng.

No it isn't.
Absoultely not. There is no reason to learn C++ before C, it will just
confuse the hell out of you. Don't do any of this. The best place to
start isn't even IN a book, its in a simple tutorial. K & R is far to
hard for a beginner to read, but some other books are okay. There are
pleanty of other ways to get confortable with C. Just google C
tutorials. What skill level are you? What do you know now? What do
you want to learn?

K&R is perfectly fine for a beginner to read, although most people will
want to read it slowly. It certainly isn't difficult; it's just very
dense, if anything.
This is also wrong. You can't exactly make mistakes reading and if you
do you have much bigger problems. In C mistakes are not learned from
so much as made into habits (if they don't generate errors). My
biggest tip if you have a warning FIX IT.

Okay. You said that he was wrong, and continued to "correct" him
with his own idea in different words.

Its not, if you want to LEARN C and not just be farmilliar with it.

Right. I often become familiar with stuff without learning it. In
fact, I use it so often that I've no idea how to even use it! Wait...
This is not true at all. In order to learn C you do not have to buy
any books at all, it helps by is not required. All sorts of info is
free in the maigcal world were EVERYTHING is, called the internet.
Hope this helps erase what he just told you.
Nori

Actually, K&R will give you a lot of correct information for a very
low cost. The Internet will give you a whole lot of crap, and it's
impossible for you to sift through it unless you already know the
language.
P.S. You did not learn C in a year, it is not possible to learn the
whole language, and it is less possible to do it in a year. I have
been LEARNING C for the past 4 years and I still have barely touched
the tip of the iceberg. A good understanding, a great understanding
even, is very differnt than KNOWING the whole thing.
N

It's not possible to learn the whole language in a year? There's under
100 keywords and operators, so even at the slow rate of one per day,
you can still learn it in a month or three.
 
J

jmcgill

P.S. You did not learn C in a year, it is not possible to learn the
whole language, and it is less possible to do it in a year.

Students in a local university program get about two weeks to learn
enough C to write for example, a program that shuffles a deck of cards,
deals poker hands, and evaluates the hands according to the rules of a
card game.

Two weeks later, they are doing substantial amounts of text processing
with pointer arithmetic, and two weeks after that they are doing dynamic
memory, structs, are starting to get a *very* good grasp of the standard
C library, can deal with the most complex C syntax, and they also know
enough of make and the linker to get by, at least in a GCC-based
environment.

That's six weeks, give or take. The C language is not complex enough to
spend "a year" learning it. Learning how to *apply* the language, that
is of course something you will do for the rest of your career.

I also disagree with the claim that K&R2 is not appropriate for a
beginner. It is a very friendly book, if a bit terse, and it does start
from the beginning concepts. What's the problem?

I agree with your basic premise that hands-on experience is the best
approach.

I don't understand what is taking you 4 years to learn. I can't imagine
that there is anything in the syntax or the standard library that you
don't know.
 
J

jmcgill

Andrew said:
It's not possible to learn the whole language in a year? There's under
100 keywords and operators, so even at the slow rate of one per day,
you can still learn it in a month or three.

It took me a few days to get an overview of the standard library. The
reason was I had jury duty which had a lot of waiting, and one of the
books I took with me was a P.J. Plauger C library reference. I read it
cover to cover!

Anyway the point is, there's very little *to* learn about the C language
itself. There are a handful of concepts that may take a certain type of
thought process to really grasp (pointer arithmetic, standards being
distinct from the implementation, and complexities that arise from the
simple grammar), but then there's the library, which also is not huge,
but must be learned as well as the language. Then of course, the
learner is faced with libraries that are specific to a target system, or
specific to some domain of applications. He might need to learn how to
program with unix sockets, or to do graphics on some graphical system,
or he might need to learn curses or other I/O libraries of that nature.
That can take years and years.

But I don't see how it takes more than a few days to actually "Learn the
C language." It's not that complex a grammar.
 
C

CBFalconer

People learn at differnt rates, and I was meerly stating my opion, I
didn't mean for it to appear the way that it did reading it over.

Please refrain from top-posting. Your comments should appear after
(or intermixed with) the relevant quoted material, i.e. after
snipping irrelevant quotes. See the following links in my sig.

--
Some informative links:
< <http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
 
R

Richard Heathfield

(e-mail address removed) said:

The best place to
start isn't even IN a book, its in a simple tutorial.
Wrong.

K & R is far to hard for a beginner to read,
Wrong.

Just google C tutorials.

And wrong.

There are so many terrible C tutorials out there. How is a beginner to know
which are good and which bad?


This is not true at all.

Yes, it is true. I think newbie knows a lot more about this than you do.
 
M

Malcolm

jmcgill said:
It took me a few days to get an overview of the standard library. The
reason was I had jury duty which had a lot of waiting, and one of the
books I took with me was a P.J. Plauger C library reference. I read it
cover to cover!

Anyway the point is, there's very little *to* learn about the C language
itself. There are a handful of concepts that may take a certain type of
thought process to really grasp (pointer arithmetic, standards being
distinct from the implementation, and complexities that arise from the
simple grammar), but then there's the library, which also is not huge,
but must be learned as well as the language. Then of course, the
learner is faced with libraries that are specific to a target system, or
specific to some domain of applications. He might need to learn how to
program with unix sockets, or to do graphics on some graphical system,
or he might need to learn curses or other I/O libraries of that nature.
That can take years and years.

But I don't see how it takes more than a few days to actually "Learn the
C language." It's not that complex a grammar.
A bought a book on C++ in Leeds, and took the bus to Bradford. I read it,
and by the time the bus had arrived, I knew C++.
That is to say, I knew all the keywords and what they meant, I knew how to
declare clas hierarchies, I knew the quirks like overloaded operators.

However fifteen years or whatever later, I am still learning how to use C++
effectively. Or to be more accurate, I've given up. I took the decision a
couple of years ago not to write any new code in C++ as long as I have the
final say in the matter.
 
S

Spiros Bousbouras

Malcolm said:
A bought a book on C++ in Leeds, and took the bus to Bradford. I read it,
and by the time the bus had arrived, I knew C++.
That is to say, I knew all the keywords and what they meant, I knew how to
declare clas hierarchies, I knew the quirks like overloaded operators.

How long does the bus from Leeds to Bradford take ,
about an hour ? Books on C++ tend to be hundreds
of pages long ; if you managed to read hundereds of
pages within 1 hour then you're a very talented person.
Did you also read and understand all the code examples
the book had ? Even without that it is still an amazing feat.
Did you remember a few days afterwards the meaning of
all the keywords ? If yes your memory is impressive.

I suspect different people mean different things by "learn"
in this thread. But I don't know how to make it more concrete.
Personally I can't imagine in my wildest dreams learning C in
a few days.
 
A

anand devarajan

hi friend,
thanks for ur idea now i need someone to give me some question
i.e to give me a question for prog to do for eg:to find prime no. it
might be simple ones for u peoples who were in high level in 'c' but i
need this type of coaching for me will any one help me so that i can
develop my programming knowledge
 
J

jmcgill

anand said:
hi friend,
thanks for ur idea now i need someone to give me some question
i.e to give me a question for prog to do

Here's a vague idea for a project that will take you through a lot of
useful concepts:


1. Model a deck of playing cards.

2. Shuffle the cards.

3. Deal poker hands from the deck.

4. Evaluate the relative values of the hands dealt.

5. Implement betting, and draw-poker with turns.
 
A

anand devarajan

sorry i dont know anything about cards so u give me someother project
work(note that the question u frame is to a beginner in c)
 
A

anand devarajan

sorry i dont know anything about cards so u give me someother project
work(note that the question u frame is to a beginner in c)
 
J

jmcgill

anand said:
sorry i dont know anything about cards so u give me someother project
work(note that the question u frame is to a beginner in c)

What I described is essentially the first significant programming
project in a local university course that includes the introduction
to C.

For the first iteration of the project, to be fair, the deck of cards
and the functions to shuffle and deal them are provided -- but in later
iterations the students are expected to implement them.


Here's a simpler idea for you:

Write a C program that will read standard input and output the number of
characters, the number of words, and the number of lines in the input.

Extend this to allow a filename argument as well as standard input.

Next, write a C program that will echo its command-line arguments to
standard output.

Extend this to allow the arguments "-c" "-w", or "-l".

Extend the program in the first part to enable the user to select
whether to count characters, words, or lines.
 
K

Keith Thompson

jmcgill said:
Here's a simpler idea for you:

Write a C program that will read standard input and output the number of
characters, the number of words, and the number of lines in the input.

Note that this requires defining exactly what a "word" is. Consider
constructing a rigorous definition to be part of the exercise. Think
about punctuation, digits, whitespace, etc.
Extend this to allow a filename argument as well as standard input.

Next, write a C program that will echo its command-line arguments to
standard output.

Extend this to allow the arguments "-c" "-w", or "-l".

I presume that refers to the word count program, not the echo program.
 
J

jmcgill

Keith said:
Note that this requires defining exactly what a "word" is. Consider
constructing a rigorous definition to be part of the exercise. Think
about punctuation, digits, whitespace, etc.

I'm being intentionally lazy in describing the problem because I have
very little confidence that the person asking for ideas intends to
follow through on them.
I presume that refers to the word count program, not the echo program.

Well, the way I'd assign it, it would end up being each.

First echo arbitrary parameters, then interpret those parameters, then
merge the other effort with this one, and you're on your way to
implementing "wc",

I wish I could have thought of a more interesting assignment, but card
games seemed to have met with a cultural barrier of some sort, and I
pretty much lost interest.
 
D

Default User

anand said:
sorry i dont know anything about cards so u give me someother project
work(note that the question u frame is to a beginner in c)

How about one that delivers electric shocks to top-posters?

Of course, that would require platform-specific elements.



Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top