C语言怎么实现从txt中读取特定数据

C语言如何实现从txt中读取特定数据?
假设txt文件内容为以下格式

abcdef 123456//字母和数字之间用空格相分割

那么如何把abcdef和123456从文件中分别读入到

char ch[20]和int num这两个变量中?
------解决思路----------------------
这样可好:

/*
abcdef 123456//字母和数字之间用空格相分割
那么如何把abcdef和123456从文件中分别读入到
*/
#include <stdio.h>
#include <string.h>
typedef struct data
{
char ch[20];
int num;
}Data;
FILE *f;
#define MAXLINE 1000
static Data ds[MAXLINE];
char buf[100];
char ch[20];
int i, r, num;
int main(void)
{
if (NULL == (f = fopen("1.txt", "r")))
{
fprintf(stderr, "Can not open file!\n");
return 1;
}
i = 0;
while (1)
{
if (NULL == fgets(buf, 100, f))break;
if ('\n' == buf[0]) continue;

r = sscanf(buf, "%20s%d", ch, &num);
if (2 == r)
{
strcpy(ds[i].ch, ch);
ds[i].num = num;
i++;
}
}
fclose(f);
for (r = 0; r < i; r++)
printf("%s %d\n", ds[r].ch, ds[r].num);
return 0;
}
//1.txt
//David 1111
//zhangxiang 2222
//lili 3333
//lalala 4444