c - How do I Extract a part of a line from a file? -


i'm new c, sorry if dumb question let's have file containing following:

1 abc 2 def 3 ghi 

if pass in integer 3 (or character?) function return string of "ghi". don't know how make happen.

void testfunc(int num) {         file *fp;         fp = fopen("testfile.txt", "r");           if(strstr?????? } 

yea.. have no idea i'm doing. can offer guidance?

you can follow link, can bit google also. simple should try own once. reading c file line line using fgetc()


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -