the code I posted was a c++ code, did you first change it into a standardized c code? It seems it can't find the header file for gets().

#include<stdio.h> should be enough. Dunno about what's wrong now.