D
D
driverx182013-04-11 23:46:20
C++ / C#
driverx18, 2013-04-11 23:46:20

Help with C programming

Hello. I got involved in such a situation that I want to learn C, I make efforts, but I don’t understand a little. For example, I taught at www.cprogramming.com (English tutorials), everything seems to be clear, but I don’t understand anything how it came to pointers. It's not even worth talking about arrays. And something like if , else if , else I understand normally. First of all, I read Dennis Ritchie's book "The C Programming Language", but there, in my opinion, everything is very, very difficult for a beginner. At the first minute of reading, everything comes to the for and while loop. So, I don’t know what to do anymore, I think, can I go to courses? Who can advise what? Maybe a book for complete "dummies"? Previously taught HTML & CSS, such difficulties as with C did not arise.

Answer the question

In order to leave comments, you need to log in

11 answer(s)
N
Nikita Gusakov, 2013-04-12
@driverx18

First, you need to understand that working with pointers and variables in general is just a fairly convenient form of working with memory. Next, compare memory with something that exists in reality - for example, a field. The variables are the peasants who break the field into pieces. Further it will become much easier.
And before moving on to pointers, have you definitely figured out static arrays and variables?
I didn’t learn C much, almost immediately switched to pluses, in this manual, in principle, the first part is common for these languages ​​- shatalov.su/ru/articles/step_by_step.php , maybe it will help you.
As for the cycles (while, for, do-while) - they are actually the same thing.
The main thing is the condition for exiting the loop. It always boils down to true/false. for and do while - this can be said to be syntactic sugar, you can do without it.
And most importantly, practice. Without practice - nowhere. You taught html and css - think, is it really possible to understand what float and position are - without trying?

D
Dmitry Falko, 2013-04-12
@lSDriim

And I would advise you to re-read Dennis Ritchie "The C Programming Language" until you are fully enlightened, if any particular item is not clear, google it. Because at one time, it was thanks to this book that I understood everything about arrays and pointers.

A
Andrey Apanasik, 2013-04-12
@Suvitruf

I can only advise you to start with C # - it’s easier to learn, it’s more convenient for applied tasks, there are no pointers (more precisely, there are, but they are usually not needed), starting to write in C after it will not be a problem.

Here I would not advise to begin with C#.
Courses are also very doubtful, because usually they don’t teach anything there, they only give a crust in the end.
I will not be a discoverer, I would advise Stroustrup to read)
ps what do you need it for?

D
Dmitry Fedin, 2013-04-12
@zloiia

Can you be more specific as to what you are studying for?

V
Vladimir Martyanov, 2013-04-12
@vilgeforce

I understood pointers well at one time only after I looked at the program in the debugger at the level of assembler commands. Then there were no questions.

K
kasthack, 2013-04-12
@kasthack

> but there, in my opinion, for a beginner everything is very, very difficult. At the first minute of reading, everything comes to the for and while loop.
Loops are the basis of all programming. The book assumes that you are already writing on something.
> Previously taught HTML & CSS, such difficulties as with C did not arise.
Not programming languages.
I can only advise you to start with C # - it is easier to learn it, it is more convenient for applied tasks, there are no pointers (more precisely, there are, but they are usually not needed), starting to write in C after it will not be a problem.

R
rPman, 2013-04-12
@rPman

I don’t advise learning starting from C, start with a simple one, it’s better to go down from the top: JavaScript -> Java or C# -> C++ -> C (such a hierarchy is too figurative and holivar, but it will do).
In this case, this will gradually allow you to study first just algorithms (JavaScript), then an object-oriented approach (Java or C #), then independent memory control (C ++) is added to this, and after that we subtract syntactic sugar and object orientation and get bare C (further only assembler and machine codes).
When learning, it is C without understanding higher programming languages ​​that will confuse how and what other programmers implement in it, the fact is that libraries very carefully implement goodies that appeared later in higher-level languages, and do it with limited language tools - for example, on macros (the language above the language is the preprocessor), and trying to understand even the simplest constructions will be very difficult.

N
nzim, 2013-04-12
@nzim

I won’t tell you about C, but there are wonderful lectures from the Lektorium on the basics of C ++, the first semester . Comparisons with C often slip through there. There is still a 2nd semester.

E
egorinsk, 2013-04-13
@egorinsk

I think you just need another C book, more detailed and patient.
As for pointers - and you read how the processor works, how random access memory (RAM) is arranged, and how bytes, numbers and strings are stored in it. A pointer is just the address of a location in memory, and once you understand the memory device, I hope everything will become clear to you. The C language is very close to the hardware (CPU and RAM) level.
Although, if your target is Objective-C, probably pointers are not that important.

R
realduke, 2013-04-13
@realduke

It seems that the only normal book on Objective C is Programming in Objective-C , if the ultimate goal is to use this language, then it’s better to start with it.
There are only two worthwhile books on C that are available to beginners, apart from the aforementioned classic The C Programming Language from the authors of the language.
Programming in C , by the same author as the first book.
C Programming: A Modern Approach
You can also check out Learn C The Hard Way by Zed Shaw, which is available online.
Good luck with your study!

C
cthulhudx, 2015-02-13
@cthulhudx

O'Relly has a good book "Learning C", I recommend reading it!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question