Re: printing a string

Jim Blandy
2008-01-09T22:29:23Z

Andrew STUBBS <andrew.stubbs at st.com> writes:
> Dave Korn wrote:
>> 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.
>
> Or, if your string is to long, or x/s is too ugly:
>
> printf "%s\n", mystring

(Not 'set print elements'?)