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
-
The actual WTF is that there are C courses out there that don't even mention #ifdef. And probably not #error either.
Maybe the classic book by Kernighan & Ritchie? Though of course this is missing some newer stuff like C99 and C11. -
@R1100 Well I'm a graphic designer who can't code. I downloaded Kali Linux. So I'm a pentester myself now, right? 😆
-
@heyheni That's for noobs. I got a Kali wallpaper on my Windows machine. h4xx0r 1337 alert!
-
@R1100 css with kali? No that would be wastetd 13373$. ARP poisening and creating pdfs that execute remote code. Teaching Blue Team what fear means. 😆
-
R-C-D157496y@heyheni cool 👊
Keep going but also try to read the codes (otherwise you'll be just a skiddie and you won't penetrate cool servers) -
mundo0349116yMost courses are basics only, what you should have learned is to fucking look for shit in the documentation.
Here, let me give you the most important skill there is:
http://bfy.tw/O8Jj -
@mundo03 never knew this site existed. This will help me deal with a lot of people, thank you!
-
#ifdef is a compiler preprocessor, it needs to allways be followed by some symbol. (e. g.
#ifdef MY_SYM) A ifdef block is ended with a #endif .
It does the following. Let's say we have this code:
#ifdef WIN64
... my c code...
#endif
Then `... my c code...` only gets _compiled_ if the symbol `WIN64` is defined. The symbol `WIN64` is defined when using some windows compiler on a 64bit system. The purpose of this is to allow one codebase to contain the code for many systems.
There also are the directives:
#elifdef
#else
These work as you would expect.
Here one longer example to show how these work. (NOTE: I am making up the symbol names as this is dependent on the compiler you use)
#ifdef WIN64
... c code for 64bit windows...
#elifdef WIN32
... c code for 32bit windows...
#elifdef LINUX64
... c code for 64bit linux...
#else
... c code for 32bit linux...
#endif
Related Rants
I was trying to understand the source code of aircrack-ng which is written in C today.
Suddenly I saw sth strange !
WTF !! what is #ifdef ??? I've never seen that before !
So I told myself : hey ! You have to download a complete C programming course!
so I did , but when I skimmed through the titles , again:
WTF ! I know all of them! So why the fuck I could not fully understand the code ? Where can I find anything I missed ?
So... I'm asking U :)
rant
course
code
wtf
source
c