#Meta-Wlp: #Macro: TITLE wlp: Learn C (III) p. 4
The string s acts as a format string in the printf. The string s contains the %s marker, which directs printf to look for a string variable among the arguments following the format string, and to substitute it in at that point. The string variable after the format string, which is substituted in at th %s, is the variable t.
#include<stdio.h> int main(){ char * s ; /* one char-star */ char * t ; /* another char-star */ /* initialize the char-star's */ s = "I am a string - " ; t = "but what am I?" ; printf(s) ; printf ("%s\n",t) ; }Is this another way to get exactly the same output? #Shuffle: none $PAGE$-A $PAGE$-B Return to Learn C Table of Contents #: No, it is different. #: Yes, it is the same. #: