Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
asgs115633yIf notes help you, go ahead. But don't go too detailed unless you want to publish a book
The technique is same old one. Read, practice, learn from mistakes, annd repeat -
C is a simple language - but its simplicity is treacherous like thin ice in early winter.
Compiler warnings are your friends, like local guides, because they tell you where the ice is thin.
Always use them. For GCC, use "-Wall -Weverything -Wpedantic" as the most important ones. Your code should not show any warnings.
If you have a warning that you don't understand, google it. Research what it means, what the danger is, why your code triggers it, and how to fix your code. -
Learn TDD (Test Driven Development). It will better enforce concepts and it would impress employers if you upload you tests and classes to GitHub.
Start writing a simple unit test to check to see if a "hello world" string is returned from a method. Then write the class to pass the unit test. -
@Voxera That comes on top, but even the language isn't quite easy. Quick check, can you answer what "ptr=malloc(0)" will do - without googling?
-
Voxera116403y@Fast-Nop no, its been 20 years since I did any serious c programming ;)
But my guess is that its not very useful but does not throw any error.
And no I did not google it ;) -
h3rp1d3v5243yThe school I go to teaches polymorphism, concurrency, and malloc in C. After the final, I throw everything out of the window and swear I am never touching C again.
-
@Fast-Nop The one time I wondered this is finally useful now ;)
Either a null pointer or some garbage pointer is returned, it's implementation dependent. -
@PrivateGER Correct, it's implementation defined, the worst compromise out of the two options. It also means that a bug in calculating memory needs may manifest in a subtly different way across platforms.
-
@h3rp1d3v There's even exception handling in C. I have ever only seen one application where that did add more clarity, and never used it personally in decades, but it does exist.
But, once you get C, it even helps you to write faster JavaScript. No shit, I don't often write it, but if I do, you can bet that it's dang fast. -
@PrivateGER Yeah, and yet, and while I can do and have done stuff with quite some languages, C is the one I love - and luckily, C doesn't count inline assembly as adultery against me. ;-)
-
eideon393yInstead of noting down I'd advice you to practice and practice until you remember the syntax, but if if something is not being easy don't worry there is always documentation to help you
-
Dear beginner, the only skill you need is acceptance of failure. You will face the failure 1000000000x more than any pleasure. Btw C is the father of everything we use today, I respect it, it is a garbage language.
I'm a beginner cs student I'm learning c language now
Should i make note of all content ?
And plz suggest me good technique to learn that language ...plz !!
question