3 ms·
I feel compelled to note that C only has the lightest possible amount of type checking, if even that. For example, the following program compiles: #include <
by tsimionescu 4y ago
I feel compelled to note that C only has the lightest possible amount of type checking, if even that. For example, the following program compiles:
#include <stdio.h>
void foo(double* c) {
printf("%g", *c);
}
void bar() {
printf("bar");
}
int main() {
int x = 9;
int* y = &x;
foo(x); //warning
foo(y); //warning
bar(1.0); //not even a warning
}