Category : C Source Code
Archive   : C-TUTOR.ZIP
Filename : POINTER2.C

 
Output of file : POINTER2.C contained in archive : C-TUTOR.ZIP
/* Chapter 8 - Program 2 */
main()
{
char strg[40],*there,one,two;
int *pt,list[100],index;

strcpy(strg,"This is a character string.");

one = strg[0]; /* one and two are identical */
two = *strg;
printf("The first output is %c %c\n",one,two);

one = strg[8]; /* one and two are indentical */
two = *(strg+8);
printf("the second output is %c %c\n",one,two);

there = strg+10; /* strg+10 is identical to strg[10] */
printf("The third output is %c\n",strg[10]);
printf("The fourth output is %c\n",*there);

for (index = 0;index < 100;index++)
list[index] = index + 100;
pt = list + 27;
printf("The fifth output is %d\n",list[27]);
printf("The sixth output is %d\n",*pt);
}


  3 Responses to “Category : C Source Code
Archive   : C-TUTOR.ZIP
Filename : POINTER2.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/