预处理程序指令不起作用

fud*_*din 0 c

我创建了一个删除空格的程序,并通过预处理程序指令使字符串大写.不会更改为大写

#include <stdio.h>
#include <conio.h>
# define TOUPPER(x) (x-32)
void main(void)
{
    int i,j;
    char str[100],*p;
    clrscr();
    printf("Enter the string:\n");
    gets(str);
    for(i=0;    ;i++)
    {
        if(str[i]=='\0')
        break;
        if(str[i]==' ')
        {
            for(j=i;    ;j++)
            {
             str[j]=str[j+1];
             if(str[j]=='\0')
             break;
            }
         }
         if(str[i]<='a'||str[i]>='z')
         {
            *p=str[i];
            TOUPPER('p');

         }


        }
        puts(str);
    getch();
}
Run Code Online (Sandbox Code Playgroud)

Gre*_*g D 8

TOUPPER('p')完全应该做什么,没有.你从数值中减去32 'p',然后扔掉它.请注意,我指的是'p'字符,而不是p指针.