我的文本档案也一样(档案中的数据也可能增加)
822
172.28.6.56
172.34.34.53
3244
5434
844
192.150.160.145
192.67.45.123
2344
234
700
192.13.56.6
192.89.95.3
4356
3566
522
172.28.6.137
172.28.6.110
2543
5245
900
255.255.255.255
244.244.244.244
2435
3245
我的结构也好像这样。
struct input_par
{
int key_node;
char src_ip[15];
char dst_ip[15];
int src_port;
int dst_port;
};
i have to fill this struture from data stored in file, once it completes inputting the 5 memebers of the structure i have to send this structure to a function i.e, i fill the structure with
822
172.28.6.56
172.34.34.53
3244
5434
然后,在将这一结构交给职能后,即再次将结构输入档案中下一个数据,即:
844
192.150.160.145
192.67.45.123
2344
234
I have to keep doing this till i reach EOF. I used fscanf it is not working properly how to do this? pls help