What am I missing here.....? :(

This is not a Zero-Day thing. This was from the original K&R Standard, before the ISO standard for function definition. I would guess that modern compilers such as gcc or clang could produce the same code for both of these examples:
Code:
foo(x, y) /* K&R */
  int x;
  float y;
{
  /* Code ... */
}
Code:
foo(int x, float y) /* ISO, PREFERRED */
{
  /* Code ... */
}
Some older or non-standard compliant compilers might not.

Oh no.... I meant that Microsoft Windows might get more Zero-Days BECAUSE of it's use of older standards, not that I thought that the ABOVE Code was Zero-Day..... :D
 


A macro is anything using #define. They are translated by the Preprocessor before the compiler sees the code.

Two examples are:

Code:
#define MAX 10    /* Use MAX anywhere 10 would be used. */
/* ... */
int ary[MAX];
Code:
#define mult(x, y) (x) * (y)

/* ... */

val = mult(2 + 3, 4 + 5);

/* Would translate to:
val = (2 + 3) * (4 + 5);
*/
Ah, so THAT'S what I was seeing with those C Tutorials..... :) DEFINE is actually a Macro.....?? :D Cool!..... ^^ Now I know what a Macro is!!..... ^^ Thank you, good sir!....... :3
 
rstanley already explained it before I could, but I will provide additional details.

The macros can also use special "IF" statements. For instance, it can test if the target system is of a particular OS or platform. If so, then certain code can get compiled instead of alternate code. This is found in many cross-platform open-source code (like the Python interpreter).

https://gcc.gnu.org/onlinedocs/cpp/Macros.html
http://www.cprogramming.com/tutorial/cpreprocessor.html
AH!..... :3 I see....... :3 So Macros are actually pretty IMPORTANT, then....... :)
 

Members online


Top