15 lines
304 B
C
15 lines
304 B
C
#include <stdio.h>
|
|
int main(void) {
|
|
// String literal assigment
|
|
char *p;
|
|
/*Following statement does not copy string. It makes pointer p to point to first charachter of list of chars*/
|
|
p = "abc";
|
|
printf("%s\n\n", p);
|
|
|
|
// ---
|
|
|
|
// Subscripting
|
|
char ch;
|
|
ch = p[1];
|
|
printf("%c\n", ch);
|
|
}
|