char str[] = "Hello World";
long *ptr = (long*)str;
printf("%s", ptr);

Output:"o World"

Long pointer increment by one increases the value of the pointer by 4 bytes. Initially the pointer was at &str[0]. After increment, the pointer will be at &str[4].

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

take input using fscanf, floating point formatting, pointers, string vs integer pointer, long pointer increment, short pointer increment, short pointer increment, memory model, near, far and huge pointer, typed pointers and void pointer,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan