top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

GDB: Difference between "ptype variable_name" and "whatis variable_name" commands

+2 votes
239 views
GDB: Difference between "ptype variable_name" and "whatis variable_name" commands
posted Jun 19, 2014 by Ganesh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

I will suggest to use ptype variable_name since it tells you the type of variable in terms of basic data structure.
For example:
In every organization, there are a set of definition for basic data types like
U16 for "unsigned short integer"
S16 for "signed short integer"
etc.
Every developer of that organization has to use U16 or S16 rather that directly use "unsigned short int" or "signed short int".

If you are debugging some thing and want to know type of variable is being used then use "ptype variable_name". it will show you type = short int.
If you use whatis variable_name then it shows you type of variable in terms of S16 or U16.

answer Jun 19, 2014 by Rupam
...