The following sample program is used in this example:
/* Program Listing for adbsamp.c */ char str1[ ] = "This is a character string"; int one = 1; int number = 456; long lnum = 1234; float fpt = 1.25; char str2[ ] = "This is the second character string"; main() { one = 2; printf("First String = %s\n",str1); printf("one = %d\n",one); printf("Number = %d\n",lnum); printf("Floating point Number = %g\n",fpt); printf("Second String = %s\n",str2); }
Compile the program using the cc command to the adbsamp file as follows:
cc -g adbsamp.c -o adbsamp
To start the debug session, enter:
adb adbsamp
Example adb Program: adbsamp2.
Example adb Program: adbsamp3.
The adb command.