一个简单的单词统计程序, 问题来源: http://topic.csdn.net/u/20111114/10/2e439bbf-04c5-4042-9905-ece0bf008b97.html
/*
功能:实现单词统计功能
*/
#include <stdio.h>
#include <string.h>
main()
{
char *t[20]; // 声明一个指针数组,长度为20
char (*t2)[20]; // 声明一个指针,该指针指向含20个元素的数组
printf("%d: %x, %x\n", sizeof(t), t, t+1);
printf("%d: %x, %x\n\n", sizeof(t2), t2, t2+1);
//return 0;
int i=0,j=0,nLen;
char *p,*q,str[]="My ti* me is! limi#ted.",words[100][20];
memset(words,'\0',sizeof(words));
p=str;
while (*p)
{
//if (*p==' ' || *p=='!' || *p==',' || *p=='.' || *p=='?')
if(!(isalpha(*p) || isdigit(*p))) // 不是字母也不是数字,则为一个单词的结束
{
if(j > 0) // 当前单词长度不为空
{
words[i&