What will this program print? char array and pointer - C String

C examples for String:char array

Description

What will this program print? char array and pointer

Demo Code

#include <stdio.h> 
#include <string.h> 
int main(void) 
{ 
   char food[] = "test test"; 
   char *ptr; //from www .  j a  v a2s  . com
 
   ptr = food + strlen(food); 
   while (--ptr >= food) 
       puts(ptr); 
   return 0; 
}

Result


Related Tutorials