This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: printing a string
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'ranjith kumar'" <ranjit_kumar_b4u at yahoo dot co dot uk>, <gdb at sourceware dot org>
- Date: Tue, 8 Jan 2008 15:35:53 -0000
- Subject: RE: printing a string
- References: <509320.35245.qm@web27407.mail.ukl.yahoo.com>
On 08 January 2008 06:06, ranjith kumar wrote:
> I know that a variable can be print in gdb by
> "print var".
>
> But how to print a string???
"print" will display a string, if you're printing a variable of type "char
*", or a std::string.
Or you can use "x" (examine) with the "/s" modifier if you just have a
memory address.
cheers,
DaveK
--
Can't think of a witty .sigline today....