The following example shows the usage of the ':c' syntax to format an expression as characters. The array must be dereferenced by the '*' operator. If the * operator is not entered, the array will be displayed as a space pointer. If the dereferencing operator is used, but the ':c' is not appended to the expression, only the first array element is displayed. The default length of the display is 1.
+--------------------------------------------------------------------------------+
| Display Module Source |
| Program: TEST3 Library: DEBUG Module: MAIN |
| 1 #include <string.h> |
| 2 char array1 [11]; |
| 3 int i; |
| 4 int main(){ |
| 5 strcpy(array1,"0123456789"); |
| 6 i = 0; |
| 7 return 0; |
| 8 } |
| Bottom |
| Debug . . . eval *array1: c 11________________________________________ |
| ________________________________________________________________________ |
| F3=Exit program F6=Add/Clear breakpoint F10=Step F11=Display variable |
| F12=Resume F17=Watch variable F18=Work with watch F24=More keys |
+--------------------------------------------------------------------------------+
The following illustrates displaying 11 characters, including a null character. The null character appears as a blank.
+--------------------------------------------------------------------------------+
| Display Module Source |
| Program: TEST3 Library: DEBUG Module: MAIN |
| 1 #include <string.h> |
| 2 char array1 [11]; |
| 3 int i; |
| 4 int main(){ |
| 5 strcpy(array1,"0123456789"); |
| 6 i = 0; |
| 7 return 0; |
| 8 } |
| Bottom |
| Debug . . . ___________________________________________________________ |
| ________________________________________________________________________ |
| F3=Exit program F6=Add/Clear breakpoint F10=Step F11=Display variable |
| F12=Resume F17=Watch variable F18=Work with watch F24=More keys |
| *array1: c 11 = '0123456789 ' ... |
+--------------------------------------------------------------------------------+
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.