[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

In this thread we write one fact about ANY technology or programming

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 3

File: 1460927877559.jpg (649KB, 900x2200px) Image search: [Google]
1460927877559.jpg
649KB, 900x2200px
In this thread we write one fact about ANY technology or programming language to teach each other. Also post infographics.

In C programming language, the #include preprocessor directive includes the header file contents to the source code file.
It does a copy-paste from headerfile.h to source.c before the compiler runs, hence it is preprocessing.

#include <someheaderfile.h>
...
>>
In C the function called "main" is special, the program starts from the first instruction in this function.

Example main function:
int main(void)
{
/*first instruction to be executed goes here*/
return 0
}
>>
The sequence of generating a program from C source code is as follows:
1. preprocessor (directives like #include etc.)
2. compiler (translates C source code to assembly)
3. assembler (translates assembly to machine code)
4. linker (embeds machine code in an executable file eg. ELF)
>>
The knapsack problem is an example of NP-complete problems.
For any k items, each having it's own weight w we are looking for such a subset of these items, so that the sum of weights inside the subset is equal to some N. In the worst case, we must check each of the 2^k subsets. If it was possible to solve the problem in polynomial (not exponential) time, then we'd prove that P=NP and get a million $.
>>
>>55097994
using the single line comment syntax

    //comment


or declaring the iteration counrer variable in a for loop like

    for (int i = 0; i < 10; i++) {
;
}


are both invalid in ANSI C or C89
a lot of C programmers don't know this because most modern compilers default to C99
>>
>>55098198
Ha! But I knew this. Anyway, it's cool that you wrote about it. I'm really pedantic about ANSI C in my simple programs.

On GNU/Linux OS one can easily see the USB devices by typing in the terminal emulator: lsusb
>>
>>55098222
>I'm really pedantic about ANSI C in my simple programs.
me too, I always write a little buildscript to call the compiler with a bunch of options including -ansi so it will fail to compile if I break the C89 standard.
>>
>>55097994
>>
File: infographics.jpg (500KB, 1232x1404px) Image search: [Google]
infographics.jpg
500KB, 1232x1404px
>>55098325
>>
>>55098398
why the tease? dump them
Thread posts: 10
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.