C General

...

Other urls found in this thread:

c-faq.com/decl/spiral.anderson.html
wiki.osdev.org/Required_Knowledge
wiki.osdev.org/Paging
masters-of-the-void.com/book5.htm
youtube.com/watch?v=eVGvPsCrQ_Y
twitter.com/SFWRedditImages

D is better

Hey I just bought that book. What am I in for? Did I get memed?

i fapped twice today


can barely feel my hands

treat it more like an encyclopedia, glossaru, dictionary rather than textbooj/instruction manual. While the goods are in there you need at least one pass before the collections become significant.

also just bought this for the class im in

I like D flat myself

You need to know it for embedded environments.

char (*(*x[3])())[5];

What does this do

Trying to parse by hand (from memory): a pointer to an array of three function pointers that take no parameters and all return an array of 5 character pointers?

Close.

OK. What did I miss? :)

Everything.

How easy is it to transition from Java to C?

Taking a C based class next semester

Not too hard, but you'll come to find out that Java has been holding your hand.

is writing an operating system a good training for mastering c, assembly and unix, and all in all becoming a proficient programmer?

It's simply an array size 3 of pointers to functions that return pointers to arrays size 5 of char.

Memory addresses are the true language of machines and CPUs.

Only through pointers can you achieve a power greater than any Java monkey.

c-faq.com/decl/spiral.anderson.html

What price should I buy that book for?

wiki.osdev.org/Required_Knowledge

declare x as an array of 5 arrays of 3 pointers to functions taking an unspecified number of arguments and returning pointers to chars

*checks cdecl* close enough

That's what I got. But I don't like messing with the function parens after an array call too much. I feel it forces the lambdas to execute in my brain and unless I'm going to give up the gold I'm not going to push that lambda process through because fuck that..

wanna learn C++, I already know C, concepts are fine, just basic syntax

explain memory management to me like a baby

Let me meme it for you.

>not using Go

real talk, i love C, it has a deep place in my heart after doing some work on embedded dynamic interpreters last summer, but after a even just a week of using go, i'm starting to realize why everyone fucking raves about it.

This. C is when you truly need the control - do you need near-perfect control on abi level? forget about Go.

But writing a reasonably complex, standalone network deamon in C? Why the hell?

because it wont get stuck in GC and bloat?

x macro
*closes book*

What's so wrong with the garbage collector in Go? Mind elaborating? As far as I was aware, Go's GC routine is pretty slick.

>GC
>in network apps that require response on demand
just admit that C is too difficult for you, no need to make up lies

>C is too difficult

i worked for the french government doing bare metal C for dynamic (JIT-esque) interpreters for javascript on AVR microcontrollers for four months, i know a reasonable amount about C and its implementation.

>feeding the trolls

you have to free the memory you allocate

Actually addresses are lies in PCs at least, physical RAM is translated via page tables into virtual memory.

Sometimes you gotta move the charcoal around in order to fiddle with the grill in a way that'll get your meat cooked for public consumption. Otherwise you put yourself and your business at risk of the wrath of the BBB or the BBC

So when I say charcoal, I mean you set your charcoal by allowing C a heap or by declaring a memset of variables that'll account for your memory footprint.
Then once you have your charcoal set you tend to cooking over it, preparing it, setting it, cooking it over short intervals, flip 'em once in a a while, keep the newer pieces closest to the lighting point for the flame (keep em close to the call point ) and ultimately make of these little protein chunks and bits logical apparitions. Got some chuck? Chilli Steak Burgers.
Got some booleans? Sieve of Eratosthenes for keeping track of all the, indexed, files that convey the condition or stipulation or some other deal as a buffer of sorts between a function process and it's io phase. Plants are proteins too? Fuck it, we'll use that data format for sound or video.

Okay maybe a metaphor isn't for children but- ...okay.


I'm still going to post this, though.

Jesus Christ. I understand memory allocation like the back of my hand, but holy shit was this one of the most convoluted analogies I've heard in my entire fucking life.

Pretty funny though.

Is C THE programming language?

Don't forget that if you fuck it up everything will burn down too.

No. C++ is, though.

explain pls?

There are three levels in data

Information - What it says to us
Data - How it's formed
Processing - How it's communicated

Information is what we get from the program when it's running.
Data in patterns and configurations is what we pass through processes.
Processing refers to the data as it is moving through the machine. Often times there are states in the data process that are considered "meta" states. What "meta-processing" deals with, majorly, is the consignment of appropriate pathways for information to pass through and the protocols and mannerism we confide in to properly and directly route that information. This is where data management comes in for C.

At the information level, memory management is only a precursor to generated performance. The memory management affects nothing.
At the data level, the principle of memory management allows us to create cycles with a parity to the system flow in order to create programs that use up less time, in cycles, to execute the same information cycles. We are given constructs to use in managing the information guidelines and manage those constructs, loops/keywords/functions/etc, to store, gather, generate meaningful patterns of information.
The thing with memory management, though, is that while it is applied as "pre-emptive" it only applies to the informational aspect in processing, although the informational aspect won't generally apply to the processing. Therefore while you can still affect the data, as it should it being the foundation of the construct for the potential of a simulcrum ( a function or an object kind of deal ) the memory management is only about how the data gets to the information level and about how that level of the process, the processing, is affecting the decisions you can make over the data in an attempt to ascertain an informational flux between user and program...To keep the ball rolling, so to speak.

That still wasn't baby but at least there's a bit of a loop to wrap yourself in.

Wrong

wiki.osdev.org/Paging

Yes, it will all burn to CHAR which will be output via the black shell thing you wheel around.

This has no connection to what you stated.

Stop shitposting

...

>Actually addresses are lies in PCs at least, physical RAM is translated via page tables into virtual memory.
>via page tables into virtual memory.
>page tables
hmmm
>wiki.osdev.org/Paging
>Paging
No connection huh?
>Paging is a system which allows each process to see the full virtual address space, without actually requiring the full amount of physical memory to be available or present.
Maybe you should go back to programming in java, pajeet.

>the memory management is only about how the data gets to the information level and about how that level of the process, the processing of the information also and concurrently processing the meta-states, is affecting the decisions you can make over the data in an attempt to ascertain an informational flux between user and program...To keep the ball rolling, so to speak. So, you read the program to the reader ( like a parent reading to his child ) using the information you gather from the "difficulty" one might encounter in answering the particular question ( service! ) and then you keep fixing it up as more and more people use it so that you can generate more meaningful memory management patterns that you can then utilize in the formation of "meaningful" information, synthetically, artificially or otherwise. Because who are we to presume your half-drake khajiit bloodkin overlord's pajeet shit-in qt3.14trap's gender when we could just provide him a habitat for each and every one at his/her/fgal/jkasld/gfsc/fdisk/dos/zsh/etc/etc time for approval in the information cycle?

I mean, what better way to rack up ad revenue than to make your service and/or app a musical activity based on the hexstatic?

Just use object pools, and you won't need GC. That's how you do real time Java applications.

whoops there should be a paragraph in there somewhere after a correction somewhere in there.


Okay, I'm going to fix my repo then send some C code through here for any newbies to improve on or literates to mock. :D

>D flat
D flat is C sharp right? Or maybe not, I'm bad with music.

anyone done any network programming?

C is where you go when you're ready to git gud. It's the call of the wild.

masters-of-the-void.com/book5.htm

I'm confused. Please, dude, I'm an idiotic nigger not even a street smart nigger but a very idiotic nigger, so if you're going to explain it, please use an analogy I can get. Like if you were explaining the matrix, or bleach or Madara. Not all of that stuff but imagine if you had to explain using terms like that.

I'm buying it for "principles of operating systems"

memory management is like organizing your ingredients on the cutting board so that when you start cutting everything fits where it is and you don't need to pull out an extra bowl or anything like that. Instead, you organize the cutting board ( memory management, allocate memory for char* here, a few char[100] there, I need my FILE* here but I'll keep the actual file contents in ram over here in this char[5000] character buffer ).

I guess if it was like naruto it would be like figuring out ways that the chakra will flow more naturally and then creating skills/spells of those flows. memory management lets you change the flow of the data by allowing you to place files of varying importance at different places on the data table and because it allows you to then use those same address maps for contemporaneous variables like the game file to be loaded rather than the autosave.

youtube.com/watch?v=eVGvPsCrQ_Y

Sockets in C is life

thats pathetic.

If that is true you are gripping way to hard.

Did some barebone use of sockets last summer. Pretty nice stuff actually.

we used sockets in our systems programming class at school

yeah

I already learned C syntax and intermediate concepts.
I can tackle Java easily?

>tfw to inteligent too comprehend

thank krishna for java

when i first learned c i was like why is it called stdio.h shouldn't it be studio.h

What would you say to someone who just picked up this book today and wants to learn C?

You're probably going to give up once you start getting into the exercises that require thinking.

>food analogy
How fat are you?

You got memed; it's not the best way to learn C in 2017 by a long shot.

Full price, brand new. It's worth it to have a shiny new copy of a modern classic in the technology genre of literature. Unless you're a poorfag.

>javascript on AVR microcontrollers
Why? What's the point of doing that rather than just writing the actual software in C in the first place?

Yeah, C today is what assembly was in the 1970s.

The heap is like a parking lot. When you park the car and get out, that's like allocating and initializing memory on the heap. You write down where in the parking lot your car is (say each space has a unique number) so you can find it again. What you're supposed to do, obviously, is later look up the number again, find that space, get in your car and drive away. That's what free() does. But if you lose the paper the number is written on, or overwrite it with something else, then you're in trouble. You can't find your way back to your car, and furthermore, nobody at the parking lot knows that you own that car either. So they just have to leave it there - you can't get it back without knowing where it is, and you're the only one that can drive it away. So it just sits there in the parking lot being useless and taking up space. If enough people do this, you'll end up using all the spaces in the parking lot, and since nobody can find their car to drive it away, there's no way to free up any of that space. That's called a memory leak.

It stands for STandarD Input and Output.

>It stands for STandarD Input and Output
Actually it's STanDard Input and Output

what would you recommend?

just use jQuery

what do you think of creat()?

When I'm using a computer and not touching the keys, why should the CPU consume any power at all

C Programming: A Modern Approach

OS has got to run

Run what? nothing will have changed

>nothing will have changed
There are background processes that are running

There are always background processes and other OS-related stuff that are open.
However, if there isn't much do be done, the kernel will put the CPU to sleep for short periods.

GET OUT

doing what?

(other than polling for input)

Whatever the background processes are doing

I got it for like $20 new because I bought the version they sell in India. It's the same exact book except instead of white, the cover is teal and the 'C' on the cover is a reddish orange instead of blue. Don't get jewed.

...

jacking off to east Taiwanese macaroni theaters

poo

>not owning the asian edition

...

installing gentoo

Sending your browser history to the NSA.

No, it's a great tool for learning the basics of the language and provides a great quick reference, worth every penny imo. Most compilers won't default to C11 anyway, and you probably won't be using many features added after C90 until you're beyond the stage of learning from a book.

I would say to start with this and then move on to so more niche C books afterwards.

Don't listen to this:

>interpreters for javascript on AVR microcontrollers for four months

Jesus. Has the French government never heard of "the right tool for the job"?