#Meta-Wlp: #Macro: TITLE wlp: Learn C (III) p. 5 #Eval: $TITLE$ #Macro: PAGE bb3-5

Yes, the output is the same.

A string is a special form of char-star, and a char-star is also called a pointer to character.
#include<stdio.h>

int main(){
  char * s ;         /* declare s a reference to character */
  char * t ;         /* declare t a reference to character */

  s = "I am a string - " ;
  t = "but what am I?" ;

  printf(s) ;
  while ( *t ) {
    printf ("%c",*t) ;
    t += 1 ;
  }

  printf("\n") ;
}
Is this another way to get exactly the same output?
Hint: %c in printf means print a single character. #Shuffle: none $PAGE$-A $PAGE$-B Return to Learn C Table of Contents #: No, it is different. #: Yes, it is the same. #: