Bloomberg Interview Question

How will you code CAT command in Unix in C++

Interview Answers

Anonymous

Oct 27, 2010

I said something about file handling, by using file pointer.

Anonymous

Nov 12, 2011

int main(int argc, char **argv) { FILE* fp=fopen(argv[1],"r"); char s; while((s=fgetc(fp))!=EOF){ printf("%c",s); } fclose(fp); }