Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- unsafe static void Main()
- {
- fixed (char* value = "sam")
- {
- char* ptr = value;
- ++ptr;
- Console.WriteLine(*ptr); // Print a [s][a][m] 0+1 -> a
- char ptr1 = *value; // Print t (Increment character e.g: s => t)
- ++ptr1;
- Console.WriteLine(ptr1);
- Console.ReadLine();
- while (*ptr != '\0')
- {
- Console.WriteLine(*ptr);
- ++ptr;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement