Can some one tell me where the string is stored ,and there is only singed char c variable please explain "" my understanding is that it reads a character checks it and prints it then read the coming one !!

#include<stdio.h>
#include<ctype.h>

main(){
  int cnt=0;
  signed  char c;

  printf("***Print Identifiers***\n\n");
  printf("Type text,terminate with EOF Z orD");

  c=getchar();

  while(c!=EOF){
        while(isspace(c))
                  c=getchar();

         if(isalpha(c)){
             while(isalnum(c)){
                 putchar(c);

                 c=getchar();

             }
             printf("\n");
             cnt++;



         }

         else if (c==EOF)
             break;

             else{
                printf("Illegal charavter %c\n",c);
                c=getchar();

             }



  }

        printf("Number of Identifiers =%d\n",cnt);
}

There is no string in your program, at all. A bunch of letters are not a string, in C. They must have an end of string char, to mark the end of the string: '\0'. Only then are letters, elevated up to string status.

A single char can never be a string. It must have at least one char, AND the end of string char (which you can not see on the screen, normally. Use your debugger to see it).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.