#if something == 0 int some=0; #endif main(){ int thing = 0; printf(“%d %dn”, some ,thing); } Answer 0 0 Explanation This code is to show that preprocessor expressions are not the same as the ordinary expressions. If a nameContinue reading… conditional compilation, preprocessor expression
Lifetime and visibility of a variable
main(){ int *j; { int i=10; j=&i; } printf(“%d”,*j); } Answer: 10 The variable i is a block level variable and the visibility is inside that block only. But the lifetime of i is lifetime of the function so itContinue reading… Lifetime and visibility of a variable
General C points
Unary + is the only dummy operator in C, you can just ignore this operator. i = – -1
Limit robots action on a specific page
Yahoo ROBOT from http://help.yahoo.com/help/us/ysearch/basics/basics-10.html If you run a web site and do not want your content to be accessible through the cache, you can use the NOARCHIVE meta-tag. Place this in the section of your documents: < META NAME="ROBOTS" CONTENT="NOARCHIVE"Continue reading… Limit robots action on a specific page
Similarity measures, text clustering or text classification
If X and Y represent the document vectors, then their similarity can be measured using different similarity measures, ^
default function prototype
When the compiler sees a new function (ex. show) about which it doesn’t know anything. It by default assumes the function to be returning int. But when compiler sees the actual definition of function (show), if mismatch occurs (might beContinue reading… default function prototype
scope of variables
labels (ex. goto ) have functions as scope. Labels which are outside the functions are not visible to this statement and cause compilation error.
printf formats in C and scanf
%p
ascii codes
‘n’
Precedence in C
!, > , < ... the expression i+++j is treated as (i++ + j) i++ + ++i