Dbx 1024 User's Guide Page 53

  • Download
  • Add to my manuals
  • Print
  • Page
    / 158
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 52
Using Data Types and Type Coercion (Casts)
39
printf string [, exp1 [, exp2, ... ] ]
Print the value(s) of the specified expression(s) in the format
specified by the string, string. The printf command supports
all formats of the IRIX printf command except “%s.” For a
list of formats, see the printf(3S) reference page.
Using Data Types and Type Coercion (Casts)
You can use data types for type conversion (casting) by including the name
of the data type in parentheses before the expression you want to cast. For
example, to convert a character into an integer, use (int) to cast the value:
(dbx) print (int) ’b’
98
To convert an integer into a character, use (char) to cast the value:
(dbx) print (char) 67
’C’
This is standard C language type casting.
Displaying and Changing Program Variables
You can use the value of program variables in dbx expressions. You can also
change the value of program variables while running your program under
dbx control.
Qualifying Variable Names
You can use the same name for different variables multiple times in the same
program. For example, you can use a temporary counter named “i” in many
different functions.
During program execution, this potential ambiguity presents no problem.
The scope of each variable is local; space is allocated for it when the function
is called and freed when the function returns.
Page view 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 157 158

Comments to this Manuals

No comments