(SOLVED)Help with ISO C++ forbids comparison between pointer and integer.

When you write &buflen, it means: the memory address of where the variable named "buflen" is stored.

Obviously you want to get the value that is stored at this address, so simply use:

for(i = 0; i < buflen; i++)